When a candidate attempts a code snippet question on Mettl platform we provide the following information to in the candidate report.
-
Total Marks scored by the candidate
Choice of Language
Total Number of test cases passed or failed with each test case details
Candidate Code Playback
Code Complexity
This article talks about the last bit Code Complexity on how we are calculating this and what all languages do we support.
Currently we calculate code complexity for the following languages
- C
- C++
- C#
- VB.Net
- PHP
The Code Complexity score is the inverse of a candidate Cyclomatic Complexity score.
A candidate Cyclomatic Complexity score is the number of linear independent path in it the less complex the candidate score is the lower the score would be and visa versa.
Code Complexity is calculated as = 100 - Cyclomatic Complexity score
The less complex the candidate code the higher the Code Complexity score in Mettl and for really complex code the score might be 0.
For all unsupported languages the score would be currently reflected as 0 , we are working actively to support all 20 languages with this score.