---
title: "Returns per-component change frequency, code health, knowledge, and counts of hotspots, uplift targets, and off-boarding risks, plus a summary of files that match no component."
method: GET
path: "/api/projects/{project-id}/quality/components/inventory"
tags: ["quality"]
---

# Returns per-component change frequency, code health, knowledge, and counts of hotspots, uplift targets, and off-boarding risks, plus a summary of files that match no component.

`GET /api/projects/{project-id}/quality/components/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/components/inventory`
- Auth: none declared

## Path parameters

- `project-id` integer, required

## Query parameters

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

## Response `200`

- ComponentInventory
  - `projectId` integer, required: Identifier of the project.
  - `asOf` string, date-time, required: ISO 8601 datetime of when the snapshot was taken.
  - `components` object[], required: Per-component inventory entries. Files that match no component are reported in the summary instead.
    - `name` string, required: Name of the architectural component.
    - `changeFrequency` integer, required: Number of commits that modified any file in the component. A commit touching several of the component's files counts once.
    - `linesOfCode` integer, required: Lines of code in the component.
    - `averageCodeHealth` object, nullable, required: Code health averaged across all files in the component. Null when no code health is available.
      - `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.
      - `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.
    - `hotspotCodeHealth` object, nullable, required: Code health averaged across the component's hotspots. Null when no code health is available.
      - `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.
      - `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.
    - `knowledge` object, nullable, required: Authorship of the component. Null when no ownership data exists.
      - `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, required: Team ownership of the component. Null when no team data exists.
      - `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, required: When any of the component's files was last modified. Null when unknown.
      - `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.
    - `fileCount` integer, required: Number of files in the component.
    - `hotspots` integer, required: Number of the component's files that are hotspots.
    - `upliftTargets` integer, required: Number of the component's files that are uplift targets of any type, including local targets.
    - `offboardingRisks` integer, required: Number of the component's files that are off-boarding risks.
  - `summary` object, required: Aggregate counts across the components, and the unmapped files.
    - `totalComponents` integer, required: Total number of components in the inventory.
    - `hotspots` integer, required: Number of hotspots across all components.
    - `upliftTargets` integer, required: Number of uplift targets, including local targets, across all components.
    - `offboardingRisks` integer, required: Number of off-boarding risks across all components.
    - `unmappedFiles` object, required: Files that match no component, and the folders holding most of them.
      - `fileCount` integer, required: Number of files that match no architectural component.
      - `topFolders` object[], required: Up to ten folders holding the most unmapped files, ordered by descending file count. Adding components for these folders covers the most unmapped code.
        - `path` string, required: Path of a folder holding unmapped files, relative to the project root.
        - `fileCount` integer, required: Number of unmapped files directly in this folder.
  - `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)
