Interview › Security & DevSecOps
What metrics does SonarQube track (coverage, duplication, code smells, bugs, vulnerabilities)? [Basic]
Answer
SonarQube tracks metrics such as coverage, duplicated lines, bugs, vulnerabilities, security hotspots, code smells, maintainability rating, reliability rating, security rating, complexity, and technical debt. These metrics drive dashboards and quality gates.
Technical explanation
Coverage is imported from test coverage tools; SonarQube analyzes and displays it but does not usually execute tests itself.
Bugs and vulnerabilities represent higher-confidence correctness or security issues, while code smells represent maintainability risks.
Duplication and complexity help identify areas that are harder to maintain and test.
Hands-on example
Example gate: new coverage >= 80 percent, duplicated lines on new code < 3 percent, zero new blocker bugs, zero new vulnerabilities, and all new security hotspots reviewed. A PR failing any condition must be fixed or explicitly reviewed before merge.
Check how well your resume matches the role with our free resume checker— match score, ATS check, and the skills you're missing.
More Security & DevSecOps interview questions
- What does 'clean as you code' mean in SonarQube, and why focus on new code? [Basic]
- What is the difference between a quality gate and a quality profile in SonarQube? [Basic]
- What is technical debt in SonarQube, and how is it estimated? [Basic]
- What is a SonarQube quality gate, and how do you use it to fail a build? [Basic]
- How does SonarQube measure code coverage, and does it run your tests? [Basic]
- Is SonarQube primarily SAST, code quality, or both? [Basic]
- What is a SonarQube hotspot, and how is it different from a vulnerability? [Basic]
- What is software composition analysis (SCA), and why does it matter for dependencies? [Basic]