What is a code quality score? How does it help in taking talent decisions?
‘Code quality’ is one of the most important parameters of programming competence in modern software engineering teams, since maintaining a clean code-base is a mandate in real-world projects. If overlooked, bad or substandard code in your code-base leads to massive technical debt that has huge negative ramifications on product and business likewise. In the DoSelect platform, a code quality score is given by evaluating candidates on 7 parameters/violations and the number of times they occur throughout the test.
Today it's helping several tech-teams in measuring how good the code is on a qualitative scale, allowing them to benchmark the skill-sets and differentiate between candidates more objectively, especially when solutions submitted are all correct from the potential hires.
How does it work?
DoSelect's Code Quality Analysis Engine works by comparing a candidate's code in a programming language against the best-practices conventions of that programming language. These conventions are generally set by that language's creator/community in general and are followed by developers universally. When a solution code is submitted on DoSelect, the engine evaluates the code with respect to that language and assigns a score on a scale of ⭐5 as to how the code adheres to the best practices convention on seven violations parameters. So, a solution with a score of, say, 4.5 is better than one with a score of 2.3.
Sample visual below can be seen in section 4, quality analysis in any of the reports, which has coding problems.
These seven code quality issues are categorized into two main types namely, Error and Warning:
- Errors are issues that fall under Complexity, Bug Risk, Security, and Performance. Highlighted in red.
- Warnings are issues that fall under Clarity, Style and Duplication. Highlighted in yellow.
(Lines that have issues are highlighted with red (error) and yellow (warning) with the detailed description above the line. See the visuals below)
Understanding the violations
Now let us understand the seven types of violations in detail, and how they help in forming an overview of the candidate skills:
- Bug Risk: To cover scenarios where the format of an executed code is vulnerable to bugs.
- Clarity: Evaluates the readability of the code and the ease with which you can find your way around when you're reviewing the code.
- Complexity: Refers to the cyclomatic complexity, used as a metric to indicate the complexity of a program. This is evaluated as a quantitative measure of the number of linearly independent paths through a program's source code
- Duplication: To check for code violations due to redundant and duplicate code that creates extensively lengthy solutions
- Performance: This takes into account the code execution time, CPU time, and memory usage in megabytes
- Style: To cater to metrics such as code formatting, whitespace, comments, character case, etc
- Security: This accounts for the security vulnerabilities present in the code. Ie, coding errors that allow attackers to easily access the system.
Where all is this applicable?
Where can it be seen in the report?
- The code quality score in the first section of the report with candidates being ⭐rated out of 5.
- The detailed version and explanation can be found in the ‘Quality analysis’ section.
- Under ‘All solutions’ for each coding problem, you can see the quality analysis and in-line violations once you enable the ‘Show quality annotations’
Normally, human code analysis requires considerable amounts of inspection in order to gather a well-rounded understanding of a candidate’s skills. With DoSelect code quality analyzer that integrates itself with human-like perceptive annotations and insights, you’d be able to get a code level understanding deeper than ever before.