Updated on 2024-11-28 GMT+08:00

Querying Issue Summary

Function

This API is used to query the issue summary based on the check task ID, including the issue overview, issue status, cyclomatic complexity, and duplication rate.

Calling Method

For details, see Calling APIs.

URI

GET /v2/tasks/{task_id}/defects-summary

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

task_id

Yes

String

Task ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

task_id

String

Task ID.

task_name

String

Task name.

creator_id

String

Creator ID.

git_url

String

Code repository address.

git_branch

String

Code repository branch. If the MR mode is used, the value is the source branch.

last_check_time

String

Last check time.

code_line_total

Integer

Lines of code.

code_line

Integer

Valid lines of code.

code_quality

Number

Code quality.

issue_count

Integer

Number of issues.

risk_coefficient

Number

Risk score.

duplication_ratio

String

Repetition ratio.

complexity_count

Integer

Complexity.

duplicated_lines

Integer

Duplicate lines.

comment_lines

Integer

Number of comment lines.

comment_ratio

String

Comment ratio.

duplicated_blocks

Integer

Duplicate blocks.

last_exec_time

String

Last execution time.

check_type

String

Check type.

created_at

String

Creation time.

cyclomatic_complexity_per_method

String

Average cyclomatic complexity.

cyclomatic_complexity_per_file

String

Average code complexity (file).

critical_count

String

Critical issues.

major_count

String

Major issues.

minor_count

String

Minor issues.

suggestion_count

String

Suggestion issues.

is_access

String

Whether the gated check-in is passed.

trigger_type

String

Task triggering mode.

file_duplication_ratio

String

File duplication rate.

new_count

Integer

New issues.

solve_count

Integer

Resolved issues.

duplicated_files

Integer

Duplicate files.

new_critical_count

String

New critical issues.

new_major_count

String

New major issues.

new_minor_count

String

New minor issues.

new_suggestion_count

String

New suggestion issues.

Status code: 400

Table 4 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 401

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Requests

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" : "2020-02-20 11:37:46",
  "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" : "2 minutes and 28 seconds",
  "check_type" : "source",
  "created_at" : "2020-02-20 11:21:11",
  "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.00000000",
  "error_msg" : "Network busy. Try again later."
}

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.