---
title: "Returns per-file change frequency, code health, hotspot flag, and uplift target classification."
method: GET
path: "/api/projects/{project-id}/quality/files/inventory"
tags: ["quality"]
---

# Returns per-file change frequency, code health, hotspot flag, and uplift target classification.

`GET /api/projects/{project-id}/quality/files/inventory`

## 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/files/inventory`
- Auth: none declared

## Path parameters

- `project-id` integer, required

## Query parameters

- `pageSize` integer
- `pageToken` string
- `sort` string

## Response `200`

- HotspotFileInventory
  - `projectId` integer, required: Identifier of the project.
  - `asOf` string, date-time, required: ISO 8601 datetime of when the snapshot was taken.
  - `files` object[], required: Per-file inventory entries.
    - `path` string, required: Path of the file relative to the project root.
    - `parentPath` string: Path of the parent folder. Present in all current results; may be absent in older cached results generated before this field was introduced.
    - `component` string: Name of the architectural component the file belongs to. Absent when the file matches no component, when the project defines no components, or in results generated before this field was introduced.
    - `changeFrequency` integer, required: Number of commits that modified this file in the analysis period.
    - `linesOfCode` integer, required: Lines of code in the file.
    - `codeHealth` object, required: Code health score and classification for this file.
      - `value` number, required: Code health score on a scale from 1 to 10.
      - `classification` 'unhealthy-code' | 'problematic-code' | 'healthy-code', nullable, required: Human-readable classification of the code health score.
      - `series` object[]: Code health a year ago, a month ago and now, oldest first. Reference points without a score are left out. Absent in results generated before this field was introduced.
        - `date` string, date, required: Date of the code-health measurement.
        - `value` number, required: Code-health score measured on this date.
      - `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.
    - `isHotspot` boolean, required: Whether this file is classified as a hotspot.
    - `upliftTarget` object, required: Uplift target classification for this file.
      - `isTarget` boolean, required: Whether this file is classified as an uplift target.
      - `type` string, nullable, required: Uplift target type (e.g. primary). Null if not a target.
    - `knowledge` object, nullable: Authorship of the file. Null when no ownership data exists. Absent in results generated before this field was introduced.
      - `mainAuthor` object, required: The author with the highest ownership of the file or component.
        - `name` string, required: Name of the author with the highest ownership of the file or component.
        - `ownership` number, required: Share (0-1) of the file's or component's added lines written by the main author.
        - `linesAdded` integer, required: Number of lines the main author added to the file or component.
        - `isActive` boolean, required: Whether the main author is an active contributor, i.e. not a former contributor.
      - `formerContributorShare` number, nullable, required: Share (0-1) of the file's or component's code written by former contributors. Null when inconclusive, e.g. when some authors are excluded from the analysis.
      - `authorCount` integer, required: Number of authors who contributed to the file or component.
      - `contributors` object[], required: Authors owning more than 10% of the file or component, ordered by descending ownership.
        - `name` string, required: Name of the contributor.
        - `ownership` number, required: Share (0-1) of the file's or component's added lines written by the contributor.
        - `isActive` boolean, required: Whether the contributor is active, i.e. not a former contributor.
    - `team` object, nullable: Team ownership of the file. Null when no team data exists. Absent in results generated before this field was introduced.
      - `mainTeam` object, nullable, required: The team owning the largest share of the file or component. Null when no team owns the code.
        - `name` string, required: Name of the team owning the largest share of the file or component.
        - `ownership` number, required: Share (0-1) of the file's or component's added lines written by the main team.
      - `authorCount` integer, nullable, required: Number of teams that contributed to the file or component.
    - `lastModified` object, nullable: When the file was last modified. Null when unknown. Absent in results generated before this field was introduced.
      - `date` string, date, nullable, required: Date of the most recent change to the file or, for a component, to any of its files.
      - `ageMonths` integer, nullable, required: Number of months since the file or component was last modified.
    - `offboardingRisk` object: Off-boarding risk of the file. Absent in results generated before this field was introduced.
      - `isRisk` boolean, required: Whether the file is an off-boarding risk: an unhealthy hotspot where half or less of the code would remain with active contributors if its two top active contributors left.
      - `remainingKnowledge` number, nullable, required: Share (0-1) of the file's code that stays with active contributors if its two top active contributors leave. Null when it can't be determined.
    - `coupling` object[], required: Files that change together with this file, strongest coupling first. Empty when the file has no temporal coupling.
      - `path` string, required: Path of the coupled file relative to the project root.
      - `couplingPercent` integer, required: How strongly the two files are coupled, as a percentage (0-100) of the changes they share. Taken from the strongest of the by-commits and across-commits couplings.
      - `averageChangeFrequency` integer, required: Average change frequency of the two coupled files: the average number of commits that modified each of them in the analysis period.
      - `component` string: Name of the architectural component the coupled file belongs to. Absent when the file matches no component or when the project defines no components.
  - `summary` object, required: Aggregate counts across the file inventory.
    - `totalFiles` integer, required: Total number of files in the inventory.
    - `hotspotCount` integer, required: Number of files classified as hotspots.
    - `upliftTargetCount` integer, required: Number of files classified as uplift targets.
    - `healthyHotspotCount` integer, required: Number of hotspots with healthy code health.
    - `offboardingRiskCount` integer: Number of files that are off-boarding risks. Absent in results generated before this field was introduced.
  - `nextPageToken` string: Opaque cursor for the next page. Absent on the last page or when all results fit in one page.

## 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)
