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.

Preparing for an interview?

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

← All Security & DevSecOps questions