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
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
|The code quality score is calculated by determining the average of maintainability, reliability, security, and cyclomatic complexity metric of the code.
|This metric indicates whether the code is easy to maintain and modify. It also indicates the minimum risks that are associated with such changes.
|This metric indicates whether the code is easy to read and maintain. A reliable code is efficient and optimized in nature.
|This metric indicates that the code is free from defects, bugs, and logic flaws.
|This metric is used to indicate the complexity of a program based on its structure.
|Click Plaintext Link to download the source code in the .txt format.
|You can toggle this setting to view violations in the code.
|The details of a major violation are displayed here. These details suggest a solution that can be used to remove the violation.
|The details of a major violation are displayed. These details indicate the solution that can be used to remove the violation.
|The code quality report is generated using the SonarQube platform.
|Number of major violations that have occurred in the code
|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.