Interview › Security & DevSecOps
What is the difference between a bug, a vulnerability, and a code smell in SonarQube? [Basic]
Answer
In SonarQube, a bug is a likely correctness problem, a vulnerability is a security flaw with a concrete exploit risk, and a code smell is a maintainability issue that may make future changes riskier or slower.
Technical explanation
Bugs affect reliability, such as null dereference or incorrect logic.
Vulnerabilities affect security, such as injection, weak cryptography, or unsafe deserialization.
Code smells affect maintainability, such as duplicated code, overly complex methods, or dead code; they are usually not immediate incidents but still create debt.
Hands-on example
Hands-on triage: treat new critical vulnerabilities as merge blockers, high-confidence bugs as blockers or required fixes, and code smells based on severity and team standards. Convert accepted technical debt into tracked backlog items rather than ignoring it.
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 metrics does SonarQube track (coverage, duplication, code smells, bugs, vulnerabilities)? [Basic]
- What is technical debt in SonarQube, and how is it estimated? [Basic]
- What does 'clean as you code' mean in SonarQube, and why focus on new code? [Basic]
- How does SonarQube measure code coverage, and does it run your tests? [Basic]
- What is the difference between a quality gate and a quality profile in SonarQube? [Basic]
- What is a SonarQube quality gate, and how do you use it to fail a build? [Basic]
- What is a SonarQube hotspot, and how is it different from a vulnerability? [Basic]
- Is SonarQube primarily SAST, code quality, or both? [Basic]