Querying Issue Summary
Function
This API is used to query the issue summary. If the request contains the task ID (task_id), the following information is returned: issue overview, issue status, cyclomatic complexity, and duplication rate.
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, 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. Obtain the ID by calling the API used to . id indicates the task ID. Constraints: N/A Value range: N/A 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 Value range: 1–100,000 characters. Default value: N/A |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
task_id |
String |
Definition: ID of a task of the old version. 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. 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 duration. Range N/A |
|
check_type |
String |
Definition Check type. Range N/A |
|
created_at |
String |
Definition Creation time. 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. Range N/A |
|
major_count |
String |
Definition Number of major issues. Range N/A |
|
minor_count |
String |
Definition Number of minor issues. Range N/A |
|
suggestion_count |
String |
Definition Number of suggestions. Range N/A |
|
is_access |
String |
Definition Whether the quality gate is passed. Range N/A |
|
review_result |
String |
Definition Whether the quality gate is passed. Range N/A |
|
trigger_type |
String |
Definition Task triggering mode. Range N/A |
|
file_duplication_ratio |
String |
Definition File duplication rate. Range N/A |
|
new_count |
Integer |
Definition: Number of new 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. Range N/A |
|
duplicated_files |
Integer |
Definition Number of duplicate files. Range N/A |
|
new_critical_count |
String |
Definition Number of new critical issues. Range N/A |
|
new_major_count |
String |
Definition Number of new major issues. Range N/A |
|
new_minor_count |
String |
Definition Number of new minor issues. Range N/A |
|
new_suggestion_count |
String |
Definition Number of new suggestions. 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
Bad Request
{
"error_code" : "CC.xxxxxxxx.400",
"error_msg" : "Verify request parameter failed. Check whether the request parameters are correct."
}
Status code: 401
Unauthorized
{
"error_code" : "CC.00000003",
"error_msg" : "Authentication information expired."
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Request succeeded! |
|
400 |
Bad Request |
|
401 |
Unauthorized |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank 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