v3

latestOpenAPI 3.1.02026-07-311725107.3 KB
Metrics

Get file metrics

Retrieve the latest values of all metrics for a file in a Project's default branch

get/gh/{ownerKeyOrId}/projects/{projectKeyOrId}/files

Path parameters

ownerKeyOrIdstring required

Repository owner name (login) or workspace ID

Example:acme-corp

Repository owner name (login) or workspace ID

projectKeyOrIdstring required

Repository name or project ID

Example:my-repo

Repository name or project ID

Query parameters

pathstring required

File path to retrieve metrics for

Example:src/index.ts

File path to retrieve metrics for

Response

Retrieve metrics for a file

Example response

{
  "data": [
    {
      "key": "CMPLX",
      "name": "Cognitive Complexity",
      "description": "Measures how hard the code is to understand",
      "category": "maintainability",
      "inverted": true,
      "valueType": "number"
    }
  ]
}