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.
![](https://support.huaweicloud.com/eu/usermanual-codecheck/public_sys-resources/note_3.0-en-us.png)
Code cyclomatic complexity is not supported for Shell.
Fixing Code Cyclomatic Complexity Issues
- Go to the Task page. In the task list, click a task name.
- On the View Task Details page, click the Metrics tab to view the cyclomatic complexity and duplicates of the completed check task.
- Click a file name to go to the file details page.
- Click
to view and modify the source code of the file.
Fixing Code Duplicates Issues
- Go to the Task page. In the task list, click a task name.
- On the View Task Details page, click the Metrics tab to view Duplicates of the completed check task.
- 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.
- Click
to view and modify the source code of the file.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.