Skip to main content
GET
/
gh
/
{ownerKeyOrId}
/
projects
/
{projectKeyOrId}
/
files
Get file metrics
curl --request GET \
  --url https://api.qlty.sh/gh/{ownerKeyOrId}/projects/{projectKeyOrId}/files \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "key": "complexity",
      "name": "Cognitive Complexity",
      "description": "Measures the cognitive load required to understand the code",
      "category": "maintainability",
      "value": 8.3,
      "inverted": true
    },
    {
      "key": "loc",
      "name": "Lines of Code",
      "description": "Total number of lines in this file",
      "category": "size",
      "value": 47,
      "inverted": true
    }
  ]
}

Authorizations

Authorization
string
header
required

Generate an API token at https://qlty.sh/user/settings/tokens

Path Parameters

ownerKeyOrId
string
required

The key or ID of the Workspace that owns the Project

projectKeyOrId
string
required

The key or ID of the Project to retrieve metrics for

Query Parameters

path
string
required

The path to the file for which to retrieve metrics

Response

Successful response

data
object[]
required

List of Metric items returned in the response