v1

latestOpenAPI 3.0.32026-07-26233989.2 KB
Analysis

Get Anti-patterns Results

Retrieves the code anti-patterns and code smell detection results for a specific repository and commit

post/api/analysis/results/antipatterns

Request body

repostring required

Repository identifier (format varies by service)

commit_idstring

Git commit SHA or identifier. Either commit_id or branch is required. If both are provided, commit_id takes precedence.

branchstring

Git branch name. When provided without commit_id, the service resolves the latest commit from scan history for this branch. Either commit_id or branch is required.

access_tokenstring required

Authentication token for the service

service'github' | 'azuredevops' | 'gitlab' | 'bitbucket' required

Version control service provider

gitlab_base_urlstring

Base URL for the service (optional for GitHub, required for GitLab)

Example request

{
  "repo": "owner/repository",
  "commit_id": "abc123def456",
  "branch": "main",
  "access_token": "ghp_xxxxxxxxxxxx",
  "service": "github",
  "gitlab_base_url": "https://gitlab.com"
}

Response

Anti-patterns results retrieved successfully

resultsobject

Anti-patterns analysis results organized by file path

Example response

{
  "results": {
    "owner/repository/abc123def456/src/utils.py/anti_patterns.json": [
      {
        "line_number": 42,
        "endLine": null,
        "issue_text": "TODO: Implement timeout for requests",
        "type": "CODE_SMELL",
        "message-id": "W0511",
        "fixAvailable": false,
        "symbol": "fixme",
        "column": 9,
        "endColumn": null,
        "severity": "Minor",
        "context_code_block": "def fetch_data(url):\n    headers = {\"Authorization\": f\"Bearer {token}\"}\n    # TODO: Implement timeout for requests\n    response = requests.get(url, headers=headers)\n    if response.status_code == 200:\n        return response.json()\n    return None"
      }
    ]
  }
}