---
title: "Returns the current Code Health state, comparison metrics, projection summaries, and Quality Gate impact."
method: GET
path: "/api/projects/{project-id}/quality/code-health"
tags: ["quality"]
---

# Returns the current Code Health state, comparison metrics, projection summaries, and Quality Gate impact.

`GET /api/projects/{project-id}/quality/code-health`

## Request

- Base URL: `https://codescene.io` (the document declares no server; this is the origin it was published from)
- URL: `https://codescene.io/api/projects/{project-id}/quality/code-health`
- Auth: none declared

## Path parameters

- `project-id` integer, required

## Response `200`

- CodeHealthSummary
  - `projectId` integer, required: The numeric ID of the project.
  - `asOf` string, date-time, required: ISO 8601 datetime of when the snapshot was taken.
  - `codeAsOf` string, date-time: ISO 8601 timestamp of the newest code included in the analysis.
  - `staleness` object: Backend-owned freshness verdict for the analysis and analyzed code.
    - `classification` 'fresh' | 'stale' | 'dormant', required: Freshness classification based on analysis age and recent commit activity.
    - `analysisAgeDays` integer, required: Whole days since the analysis snapshot.
    - `codeAgeDays` integer, required: Whole days since the latest commit activity.
  - `repositories` object[]: Latest analyzed revision per repository.
    - `name` string, required: Repository name from the analyzed file paths.
    - `sha` string, required: Analyzed Git commit SHA.
    - `codeAsOf` string, date-time, required: ISO 8601 timestamp of the analyzed commit.
    - `commitUrl` string, nullable: Provider commit link when a repository URL is available.
  - `comparisonPeriod` object, required: Date range used to compute the delta values.
    - `from` string, date, required: Start date of the period (inclusive).
    - `to` string, date, required: End date of the period (inclusive).
  - `languages` object[]: Analyzed languages supported by CodeScene, with file and code counts.
    - `name` string, required: Analyzed language supported by CodeScene.
    - `fileCount` integer, required: Number of analyzed files in this language.
    - `linesOfCode` integer, required: Lines of code analyzed for this language.
  - `averageCodeHealth` object: Code health averaged across all files in the project. Absent if no analysis exists.
    - `value` number, nullable, required: Code health score on a scale from 1 to 10.
    - `delta` number, nullable, required: Change in code health score relative to the comparison period. Null if no prior data.
    - `classification` 'unhealthy-code' | 'problematic-code' | 'healthy-code', nullable, required: Human-readable classification of the code health score (e.g. healthy-code, problematic-code, unhealthy-code).
    - `nextGoal` object, nullable: Next benchmark threshold to reach. Present when a higher threshold remains.
      - `id` string, required: Unique identifier of the benchmark entry.
      - `label` string, required: Human-readable label for the benchmark entry.
      - `type` 'threshold' | 'benchmark' | 'ai-readiness', required: The source and context for the entry: benchmark, threshold, or ai-readiness score.
      - `value` number, required: Numeric value associated with the benchmark entry.
    - `trend` TrendInterpretation
      - `direction` 'improving' | 'declining' | 'steady', required: Normalized trend direction for reusable trend consumers.
      - `pace` 'slow' | 'fast', nullable, required: Normalized trend pace. Null when the direction is steady.
    - `series` object[]: Dated code-health history over the comparison period. Empty when no usable measurements exist.
      - `date` string, date, required: Date of the code-health measurement.
      - `value` number, required: Code-health score measured on this date.
  - `hotspotCodeHealth` object: Code health averaged across hotspot files in the project. Absent if no analysis exists.
    - `value` number, nullable, required: Code health score on a scale from 1 to 10.
    - `delta` number, nullable, required: Change in code health score relative to the comparison period. Null if no prior data.
    - `classification` 'unhealthy-code' | 'problematic-code' | 'healthy-code', nullable, required: Human-readable classification of the code health score (e.g. healthy-code, problematic-code, unhealthy-code).
    - `nextGoal` object, nullable: Next benchmark threshold to reach. Present when a higher threshold remains.
      - `id` string, required: Unique identifier of the benchmark entry.
      - `label` string, required: Human-readable label for the benchmark entry.
      - `type` 'threshold' | 'benchmark' | 'ai-readiness', required: The source and context for the entry: benchmark, threshold, or ai-readiness score.
      - `value` number, required: Numeric value associated with the benchmark entry.
    - `trend` TrendInterpretation
      - `direction` 'improving' | 'declining' | 'steady', required: Normalized trend direction for reusable trend consumers.
      - `pace` 'slow' | 'fast', nullable, required: Normalized trend pace. Null when the direction is steady.
    - `series` object[]: Dated code-health history over the comparison period. Empty when no usable measurements exist.
      - `date` string, date, required: Date of the code-health measurement.
      - `value` number, required: Code-health score measured on this date.
  - `aiReadinessContext` object: AI readiness interpretation and next goal for the latest scores.
    - `averageCodeHealth` object: Interpretation and next goal for average code health.
      - `interpretation` object, required: Benchmark interpretation of the current code health score.
        - `id` string, required: Unique identifier of the benchmark entry.
        - `label` string, required: Human-readable label for the benchmark entry.
        - `type` 'threshold' | 'benchmark' | 'ai-readiness', required: The source and context for the entry: benchmark, threshold, or ai-readiness score.
        - `value` number, required: Numeric value associated with the benchmark entry.
      - `nextGoal` object, nullable, required: Next benchmark threshold to reach. Absent when the score is already at the top.
        - `id` string, required: Unique identifier of the benchmark entry.
        - `label` string, required: Human-readable label for the benchmark entry.
        - `type` 'threshold' | 'benchmark' | 'ai-readiness', required: The source and context for the entry: benchmark, threshold, or ai-readiness score.
        - `value` number, required: Numeric value associated with the benchmark entry.
    - `hotspotCodeHealth` object: Interpretation and next goal for hotspot code health.
      - `interpretation` object, required: Benchmark interpretation of the current code health score.
        - `id` string, required: Unique identifier of the benchmark entry.
        - `label` string, required: Human-readable label for the benchmark entry.
        - `type` 'threshold' | 'benchmark' | 'ai-readiness', required: The source and context for the entry: benchmark, threshold, or ai-readiness score.
        - `value` number, required: Numeric value associated with the benchmark entry.
      - `nextGoal` object, nullable, required: Next benchmark threshold to reach. Absent when the score is already at the top.
        - `id` string, required: Unique identifier of the benchmark entry.
        - `label` string, required: Human-readable label for the benchmark entry.
        - `type` 'threshold' | 'benchmark' | 'ai-readiness', required: The source and context for the entry: benchmark, threshold, or ai-readiness score.
        - `value` number, required: Numeric value associated with the benchmark entry.
  - `teams` object[]: Code health breakdown per team.
    - `name` string, required: Display name of the team or component.
    - `analyticalUnitId` integer: Analytics analytical-unit ID for this team or component.
    - `linesOfCode` integer: Latest analyzed lines of code for this team or component.
    - `averageCodeHealth` object, required: Code health averaged across all files in this scope.
      - `value` number, nullable, required: Code health score on a scale from 1 to 10.
      - `delta` number, nullable, required: Change in code health score relative to the comparison period. Null if no prior data.
      - `classification` 'unhealthy-code' | 'problematic-code' | 'healthy-code', nullable, required: Human-readable classification of the code health score (e.g. healthy-code, problematic-code, unhealthy-code).
      - `nextGoal` object, nullable: Next benchmark threshold to reach. Present when a higher threshold remains.
        - `id` string, required: Unique identifier of the benchmark entry.
        - `label` string, required: Human-readable label for the benchmark entry.
        - `type` 'threshold' | 'benchmark' | 'ai-readiness', required: The source and context for the entry: benchmark, threshold, or ai-readiness score.
        - `value` number, required: Numeric value associated with the benchmark entry.
      - `trend` TrendInterpretation
        - `direction` 'improving' | 'declining' | 'steady', required: Normalized trend direction for reusable trend consumers.
        - `pace` 'slow' | 'fast', nullable, required: Normalized trend pace. Null when the direction is steady.
      - `series` object[]: Dated code-health history over the comparison period. Empty when no usable measurements exist.
        - `date` string, date, required: Date of the code-health measurement.
        - `value` number, required: Code-health score measured on this date.
    - `hotspotCodeHealth` object, required: Code health averaged across hotspot files in this scope.
      - `value` number, nullable, required: Code health score on a scale from 1 to 10.
      - `delta` number, nullable, required: Change in code health score relative to the comparison period. Null if no prior data.
      - `classification` 'unhealthy-code' | 'problematic-code' | 'healthy-code', nullable, required: Human-readable classification of the code health score (e.g. healthy-code, problematic-code, unhealthy-code).
      - `nextGoal` object, nullable: Next benchmark threshold to reach. Present when a higher threshold remains.
        - `id` string, required: Unique identifier of the benchmark entry.
        - `label` string, required: Human-readable label for the benchmark entry.
        - `type` 'threshold' | 'benchmark' | 'ai-readiness', required: The source and context for the entry: benchmark, threshold, or ai-readiness score.
        - `value` number, required: Numeric value associated with the benchmark entry.
      - `trend` TrendInterpretation
        - `direction` 'improving' | 'declining' | 'steady', required: Normalized trend direction for reusable trend consumers.
        - `pace` 'slow' | 'fast', nullable, required: Normalized trend pace. Null when the direction is steady.
      - `series` object[]: Dated code-health history over the comparison period. Empty when no usable measurements exist.
        - `date` string, date, required: Date of the code-health measurement.
        - `value` number, required: Code-health score measured on this date.
    - `links` object: Related resource links for this scope.
      - `trend` string, required
  - `components` object[]: Code health breakdown per component.
    - `name` string, required: Display name of the team or component.
    - `analyticalUnitId` integer: Analytics analytical-unit ID for this team or component.
    - `linesOfCode` integer: Latest analyzed lines of code for this team or component.
    - `averageCodeHealth` object, required: Code health averaged across all files in this scope.
      - `value` number, nullable, required: Code health score on a scale from 1 to 10.
      - `delta` number, nullable, required: Change in code health score relative to the comparison period. Null if no prior data.
      - `classification` 'unhealthy-code' | 'problematic-code' | 'healthy-code', nullable, required: Human-readable classification of the code health score (e.g. healthy-code, problematic-code, unhealthy-code).
      - `nextGoal` object, nullable: Next benchmark threshold to reach. Present when a higher threshold remains.
        - `id` string, required: Unique identifier of the benchmark entry.
        - `label` string, required: Human-readable label for the benchmark entry.
        - `type` 'threshold' | 'benchmark' | 'ai-readiness', required: The source and context for the entry: benchmark, threshold, or ai-readiness score.
        - `value` number, required: Numeric value associated with the benchmark entry.
      - `trend` TrendInterpretation
        - `direction` 'improving' | 'declining' | 'steady', required: Normalized trend direction for reusable trend consumers.
        - `pace` 'slow' | 'fast', nullable, required: Normalized trend pace. Null when the direction is steady.
      - `series` object[]: Dated code-health history over the comparison period. Empty when no usable measurements exist.
        - `date` string, date, required: Date of the code-health measurement.
        - `value` number, required: Code-health score measured on this date.
    - `hotspotCodeHealth` object, required: Code health averaged across hotspot files in this scope.
      - `value` number, nullable, required: Code health score on a scale from 1 to 10.
      - `delta` number, nullable, required: Change in code health score relative to the comparison period. Null if no prior data.
      - `classification` 'unhealthy-code' | 'problematic-code' | 'healthy-code', nullable, required: Human-readable classification of the code health score (e.g. healthy-code, problematic-code, unhealthy-code).
      - `nextGoal` object, nullable: Next benchmark threshold to reach. Present when a higher threshold remains.
        - `id` string, required: Unique identifier of the benchmark entry.
        - `label` string, required: Human-readable label for the benchmark entry.
        - `type` 'threshold' | 'benchmark' | 'ai-readiness', required: The source and context for the entry: benchmark, threshold, or ai-readiness score.
        - `value` number, required: Numeric value associated with the benchmark entry.
      - `trend` TrendInterpretation
        - `direction` 'improving' | 'declining' | 'steady', required: Normalized trend direction for reusable trend consumers.
        - `pace` 'slow' | 'fast', nullable, required: Normalized trend pace. Null when the direction is steady.
      - `series` object[]: Dated code-health history over the comparison period. Empty when no usable measurements exist.
        - `date` string, date, required: Date of the code-health measurement.
        - `value` number, required: Code-health score measured on this date.
    - `links` object: Related resource links for this scope.
      - `trend` string, required
  - `projections` object[]: Projections showing the code health impact of individual sub-systems or components.
    - `id` string, required: Unique identifier of the projection.
    - `name` string, required: Display name of the projection.
    - `averageCodeHealthDifference` number, required: Difference in average code health attributable to this projection.
    - `hotspotCodeHealthDifference` number, required: Difference in hotspot code health attributable to this projection.
    - `links` object, required: Related resource links for this projection.
      - `trend` string, required
  - `qualityGateImpact` object: Summary of how the quality gate has influenced code health over the comparison period.
    - `preventedDeclines` integer, required: Number of code health declines prevented by the quality gate.
    - `links` object, required: Related resource links for the quality gate impact.
      - `details` string, required
  - `links` object: Top-level resource links related to this summary.
    - `benchmarks` string, required
    - `trend` string, required
    - `projections` string, required
    - `qualityGateImpact` string, required

## Other responses

- `400`
- `401`
- `403`
- `404`

---

[API](https://skmtc.dev/codescene/apis/codescene-api.md) · [All operations](https://skmtc.dev/codescene/apis/codescene-api/llms.txt) · [OpenAPI document](https://skmtc.dev/codescene/apis/codescene-api/revisions/e443e0b6bc89?raw)
