Skip to main content
POST
/
api
/
analysis
/
results
/
antipatterns
Get Anti-patterns Results
curl --request POST \
  --url https://api.codeant.ai/api/analysis/results/antipatterns \
  --header 'Content-Type: application/json' \
  --data '{
  "repo": "owner/repository",
  "commit_id": "abc123def456",
  "access_token": "ghp_xxxxxxxxxxxx",
  "service": "github"
}'
{
  "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"
      }
    ]
  }
}

Body

application/json
repo
string
required

Repository identifier (format varies by service)

Example:

"owner/repository"

commit_id
string
required

Git commit SHA or identifier

Example:

"abc123def456"

access_token
string
required

Authentication token for the service

Example:

"ghp_xxxxxxxxxxxx"

service
enum<string>
required

Version control service provider

Available options:
github,
azuredevops,
gitlab,
bitbucket
Example:

"github"

gitlab_base_url
string

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

Example:

"https://gitlab.com"

Response

Anti-patterns results retrieved successfully

Anti-patterns response containing detected code smells and anti-patterns

results
object

Anti-patterns analysis results organized by file path

Example:
{
"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"
}
]
}