HackerEarth Assessment enables you to assess code based on various key metrics that are used to define the efficiency and usability of the code. These key metrics are as follows:
- Cyclomatic complexity
Viewing the code quality score
To view the code quality score of a candidate, follow these steps:
- Log into your HackerEarth Assessment account using your admin credentials.
- Click Tests.
- Click the name of the test in which you want to view the code quality score of a candidate.
- In the Candidates section, click Test taken, Review pending, or Shortlisted to view the profile of the candidate.
- Click the name of the candidate to view the details of the candidate.
- In the Detailed submission report section, navigate to the Programming questions section to view the code quality score.
- Click .
- Click Details and code quality.
The code quality report is displayed.
Parts of a code quality report
|1||The code quality score is calculated by determining the average of maintainability, reliability, security, and cyclomatic complexity metric of the code.|
|2||This metric indicates whether the code is easy to maintain and modify. It also indicates the minimum risks that are associated with such changes.|
|3||This metric indicates whether the code is easy to read and maintain. A reliable code is efficient and optimized in nature.|
|4||This metric indicates that the code is free from defects, bugs, and logic flaws.|
|5||This metric is used to indicate the complexity of a program based on its structure.|
|6||Click Plaintext Link to download the source code in the .txt format.|
|7||You can toggle this setting to view violations in the code.|
|8||The details of a major violation are displayed here. These details suggest a solution that can be used to remove the violation.|
|9||The details of a major violation are displayed. These details indicate the solution that can be used to remove the violation.|
|10||The code quality report is generated using the SonarQube platform.|
|11||Number of major violations that have occurred in the code|
|12||Number of minor violations that have occurred in the code|
Note: The violations in a code indicate that candidates have not followed certain ethics to write code. These ethics are used to write understandable and efficient code.