Updated on 2024-01-24 GMT+08:00

Viewing Code Metrics

Code metrics reflect the quality of committed code, helping you detect and fix issues in a timely manner and improving R&D efficiency.

  • Cyclomatic Complexity: Measures code complexity. You can determine the logic complexity and modify the code based on the cyclomatic complexity, facilitating subsequent maintenance.
  • Duplicates: Evaluates code quality risks. You can modify the redundant code to improve the code quality.

Code cyclomatic complexity is not supported for Shell.

Fixing Code Cyclomatic Complexity Issues

  1. Go to the Task page. In the task list, click a task name.
  2. On the View Task Details page, click the Metrics tab to view the cyclomatic complexity and duplicates of the completed check task.
  3. Click a file name to go to the file details page.
  4. Click to view and modify the source code of the file.

Fixing Code Duplicates Issues

  1. Go to the Task page. In the task list, click a task name.
  2. On the View Task Details page, click the Metrics tab to view Duplicates of the completed check task.
  3. Click a file name to go to the file details page.

    The vertical bars on the left of the file details page identify duplicated code blocks. If you click a vertical bar, the list of files that contain the same code blocks is displayed.

    Click a file name to compare the duplicated code blocks of the two files.

  4. Click to view and modify the source code of the file.