Querying Issue Summary
Function
This API is used to query the issue result summary, including the issue overview, issue status, cyclomatic complexity, and code duplication rate, based on the task ID.
Calling Method
For details, see Calling APIs.
Authorization Information
Each account root user has all the permissions required to call all APIs, but IAM users must be assigned the following required identity policy-based permissions. For details about the required permissions, see Permissions Policies and Supported Actions.
| Action | Access Level | Resource Type (*: required) | Condition Key | Alias | Dependencies |
|---|---|---|---|---|---|
| codeartscheck:task:getReport | Read | task * | - | - | - |
| - | codeartscheck:ProjectId |
URI
GET /v2/tasks/{task_id}/defects-summary
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| task_id | Yes | String | Definition : Task ID, which is the return value of the API used to create a check task. Each check task, its brach tasks, and incremental tasks created through APIs have a unique task ID. Obtain the ID by calling the API used to query the task list. id indicates the task ID. Constraints: N/A. Value range: 1 to 32 characters. Default value: N/A. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| job_id | No | String | Definition Execution record ID, that is, the unique ID of each version or quality gate scan. The ID is used to query quality gate tasks. Constraints N/A Range N/A Default Value N/A |
| merge_id | No | String | Definition Merge request ID or commit ID. They are used to query quality gate tasks. Constraints N/A Range N/A Default Value N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | Definition User token. Obtain one by calling the IAM API Obtaining a User Token. The value of X-Subject-Token in the response header is a token. Constraints N/A Range The length is the value of [1-100000]. Default Value N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| task_id | String | Definition: ID of a task of the old version. The ID is returned by the API for creating a check task. Each code check task, branch task, or incremental task generated through an API has a unique ID. Value range: N/A. |
| task_name | String | Definition Task name. Range N/A |
| creator_id | String | Definition User ID of the task creator. Range N/A |
| git_url | String | Definition Code repository address. Range N/A |
| git_branch | String | Definition Code repository branch. Specify a source branch in MR mode. Range N/A |
| last_check_time | String | Definition: Last check time. The value is a UTC time in the format of yyyy-MM-ddTHH:mm:ssZ, for example, 2020-09-25T12:05:00Z. Value range: N/A. |
| code_line_total | Integer | Definition Original code lines, including blank and comment lines. Range N/A |
| code_line | Integer | Definition Valid code lines, excluding blank and comment lines. Range N/A |
| code_quality | Number | Definition Code quality. Range N/A |
| issue_count | Integer | Definition: Number of pending issues. Value range: N/A. |
| risk_coefficient | Number | Definition Risk score. Range N/A |
| duplication_ratio | String | Definition Duplication rate. Range N/A |
| complexity_count | Integer | Definition Total cyclomatic complexity. Range N/A |
| duplicated_lines | Integer | Definition Total number of duplicate lines. Range N/A |
| comment_lines | Integer | Definition Number of comment lines. Range N/A |
| comment_ratio | String | Definition Comment line percentage. Range N/A |
| duplicated_blocks | Integer | Definition Number of duplicate blocks. Range N/A |
| last_exec_time | String | Definition Last execution time. Use UTC time in format "yyyy-MM-ddTHH:mm:ssZ". For example, 2020-09-25T12:05:00Z. Range N/A |
| check_type | String | Definition This field is deprecated. Range N/A |
| created_at | String | Definition: Creation time. The value is a UTC time in the format of yyyy-MM-ddTHH:mm:ssZ, for example, 2020-09-25T12:05:00Z. Value range: N/A. |
| cyclomatic_complexity_per_method | String | Definition Average cyclomatic complexity per method. Range N/A |
| cyclomatic_complexity_per_file | String | Definition Average cyclomatic complexity per file. Range N/A |
| critical_count | String | Definition: Number of critical issues, excluding ignored and fixed issues. Value range: N/A. |
| major_count | String | Definition: Number of major issues, excluding ignored and fixed issues. Value range: N/A. |
| minor_count | String | Definition: Number of minor issues, excluding ignored and fixed issues. Value range: N/A. |
| suggestion_count | String | Definition: Number of suggestion issues, excluding ignored and fixed issues. Value range: N/A. |
| is_access | String | Definition Whether the quality gate is passed. Range |
| review_result | String | Definition Whether the quality gate is passed. Range N/A |
| trigger_type | String | Definition: Task triggering mode. Value range: |
| file_duplication_ratio | String | Definition File duplication rate. Range N/A |
| new_count | Integer | Definition: Number of new issues, excluding ignored and fixed issues. Value range: N/A. |
| solve_count | Integer | Definition: Number of resolved and fixed issues. Value range: N/A. |
| dismissed_count | Integer | Definition: Number of ignored issues. Value range: N/A. |
| duplicated_files | Integer | Definition Number of duplicate files. Range N/A |
| new_critical_count | String | Definition: Number of new critical issues, excluding ignored and fixed issues. Value range: N/A. |
| new_major_count | String | Definition: Number of new major issues, excluding ignored and fixed issues. Value range: N/A. |
| new_minor_count | String | Definition: Number of new minor issues, excluding ignored and fixed issues. Value range: N/A. |
| new_suggestion_count | String | Definition: Number of new suggestion issues, excluding ignored and fixed issues. Value range: N/A. |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition: Error code. Value range: N/A |
| error_msg | String | Definition: Error message. Value range: N/A |
Status code: 401
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition: Error code. Value range: N/A |
| error_msg | String | Definition: Error message. Value range: N/A |
Example Requests
Query the issue summary of task ID 2b31ed520xxxxxxebedb6e57xxxxxxxx.
GET https://{endpoint}/v2/tasks/2b31ed520xxxxxxebedb6e57xxxxxxxx/defects-summary Example Responses
Status code: 200
Request succeeded.
{
"task_id" : "435b58ecf7f54c45907c1384d01c94a6",
"task_name" : "CSharp_02201119",
"creator_id" : "ecadebb5041146cc96f9780f3d905e20",
"git_url" : "git@****_02201119.git",
"git_branch" : "master",
"last_check_time" : "2025-11-05T02:05:20Z",
"code_line_total" : 20,
"code_line" : 156,
"code_quality" : 147.4,
"issue_count" : 3,
"risk_coefficient" : 23,
"duplication_ratio" : "0.0%",
"complexity_count" : 0,
"duplicated_lines" : 0,
"comment_lines" : 0,
"comment_ratio" : "0",
"duplicated_blocks" : 0,
"last_exec_time" : "2025-11-05T02:05:20Z",
"check_type" : "source",
"created_at" : "2025-11-05T02:03:57Z",
"cyclomatic_complexity_per_method" : "84.0",
"cyclomatic_complexity_per_file" : "112.0",
"critical_count" : 2,
"major_count" : 1,
"minor_count" : 1,
"suggestion_count" : 1,
"is_access" : 0,
"trigger_type" : 1,
"file_duplication_ratio" : "33.3%",
"new_count" : 0,
"solve_count" : 0,
"duplicated_files" : 0,
"new_critical_count" : "0",
"new_major_count" : "0",
"new_minor_count" : "0",
"new_suggestion_count" : "0"
} Status code: 400
A request error occurred.
{
"error_code" : "CC.xxxxxxxx.400",
"error_msg" : "Verify request parameter failed. Check whether the request parameters are correct."
} Status code: 401
The permission is insufficient.
{
"error_code" : "CC.00000003",
"error_msg" : "Authentication information expired."
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Request succeeded. |
| 400 | A request error occurred. |
| 401 | The permission is insufficient. |
Error Codes
See Error Codes.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot