What does SonarQube analyse?
BeginnerConceptSonarQube
Answer
Short answer
SonarQube performs static code analysis — it reads source code without running it and reports bugs, vulnerabilities, security hotspots, code smells (maintainability issues), duplicated code and test coverage, for 30+ languages. It then decides pass/fail with a quality gate.
What each term means
| Category | Meaning | Example |
|---|---|---|
| Bug | Code that's likely wrong | Null pointer dereference, resource never closed |
| Vulnerability | Code an attacker can exploit | SQL built from user input (SQL injection) |
| Security hotspot | Security-sensitive code a human must review | Use of a weak hash, CORS *, disabled CSRF |
| Code smell | Hard-to-maintain code | 300-line method, deeply nested ifs |
| Duplication | Copy-pasted blocks | Same 40 lines in 3 files |
| Coverage | % of code executed by tests | Imported from JaCoCo, coverage.py, lcov |
Ratings
A–E ratings for Reliability (bugs), Security (vulnerabilities) and Maintainability (technical debt).
What to say in the interview
"SonarQube does SAST and code quality: it finds bugs, vulnerabilities, security hotspots, code smells and duplication, imports test coverage, and enforces a quality gate in the pipeline."
More on SonarQube
What is SonarQube and how do you integrate it into a pipeline?BeginnerHow do you run SonarQube locally with Docker?BeginnerHow do you scan a project with sonar-scanner?BeginnerHow do you run SonarQube analysis for a Maven project?BeginnerWhat is a quality gate in SonarQube?BeginnerHow do you make a Jenkins pipeline fail when the SonarQube quality gate fails?Intermediate