10 August 2023

how to read a SonarQube code analysis report

Here, I've broken down each metric (ideal value in brackets) as a quick byte.

→ Code Coverage Percentage (> 80%):
        Ensures a high proportion of your code is tested, reducing bugs. 

→ Technical Debt Ratio (< 5%):
        Measures how much code needs refactoring for maintainability. 

→ Number of Bugs (Ideally 0):
        Counts coding errors needing fixes for functional integrity. 

→ Security Vulnerabilities (Minimal):
        Identifies potential security risks needing attention. 

→ Code Smells Count (Minimal):
        Detects 'smelly' code that may need improvement for better readability. 

→ Duplications Percentage (< 3%):
        Highlights repeated code blocks that should be simplified. 

→ Security Hotspots Reviewed (100%):
        Ensures all potential security risks are examined. 

→ Complexity Metrics (Cyclomatic Complexity < 10):
        Evaluates how complicated the code is, aiming for simplicity. 

→ Coding Rules Compliance (Close to 100%):
        Shows adherence to set coding standards for quality. 

→ Quality Gate Status (Passed):
        Indicates the overall health of the codebase, based on set criteria.