Code quality score

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:

  1. Maintainability
  2. Reliability
  3. Security
  4. Cyclomatic complexity
Viewing the code quality score

To view the code quality score of a candidate, follow these steps:

  1. Log into your HackerEarth Assessment account using your admin credentials.
  2. Click Tests.
  3. Click the name of the test in which you want to view the code quality score of a candidate.
  4. In the Candidates section, click Test taken, Review pending, or Shortlisted to view the profile of the candidate.
  5. Click the name of the candidate to view the details of the candidate.
  6. In the Detailed submission report section, navigate to the Programming questions section to view the code quality score.
  7. Click arrow_code_quality.png.
  8. Click Details and code quality.

The code quality report is displayed.

Parts of a code quality report
code_quality_reprot.png

S. No. Description
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.