Explore our new Cybersecurity Terms Glossary, explained by our experts.

View the Glossary View the Glossary
PRIVIA

Cybersecurity Terms Glossary

What Is SonarQube?

SonarQube is a code quality and static analysis platform from SonarSource. It reports bugs, maintainability problems, security vulnerabilities, and security hotspots, and gates merges on a quality gate.

Illustration for the cybersecurity term SonarQube
Home / Blog / Cybersecurity Terms / What Is SonarQube?
17 November 2026

What Is SonarQube?

What Is SonarQube?

SonarQube is a self-hosted platform that analyses source code and reports what it finds: defects, maintainability problems, duplicated code, missing test coverage, and security issues. SonarSource has developed it from Geneva since 2008, and it is probably the most widely deployed static analysis server in corporate development.

It is important to be clear about what it primarily is. SonarQube is a code quality tool that also does security analysis, not a security tool that happens to comment on quality. That distinction explains both its strengths and the places where teams are disappointed by it.

Issues, Vulnerabilities, and Hotspots

Findings fall into categories, and one of them is distinctive. A vulnerability is something the analyser believes is exploitable. A security hotspot is code that is security-sensitive but not necessarily wrong: a cryptographic call, a use of randomness, a permissive CORS setting, a command execution. Hotspots are not counted as defects. They are routed to a human to review and mark as safe or as a genuine vulnerability.

This is a sensible design that is routinely misunderstood. Teams look at a clean vulnerability count, declare the code secure, and never open the hotspot queue — where the interesting material often sits. If you run SonarQube, make hotspot review part of the workflow rather than an optional screen.

Quality Gates and Clean as You Code

The quality gate is the feature that changes behaviour. It is a set of conditions evaluated after each analysis, and the default profile applies them to new code only: no new issues, coverage on new lines above 80 per cent, duplication on new lines below 3 per cent, all new hotspots reviewed.

Scoping conditions to new code is what makes adoption possible on an old codebase. Demanding that a twelve-year-old application reach 80 per cent coverage stops work; demanding it of the lines changed this week does not, and the codebase improves wherever it is touched. In continuous integration, sonar.qualitygate.wait=true makes the pipeline block on the result rather than reporting it after the merge.

Editions Determine the Security Value

This is the single most important practical point. The free Community Build performs rule-based analysis within a single file. Taint analysis — tracking untrusted input across methods and files to a dangerous sink — is only available from the Developer Edition upwards.

Injection flaws are precisely what taint analysis finds. A team running the Community Build and expecting it to catch SQL injection reaching a query helper three files away will not get it, and the clean dashboard will suggest otherwise. Pull request decoration, branch analysis, and several language analysers are likewise paid features.

If budget is the constraint, pairing the Community Build with Semgrep for security rules is a more honest configuration than relying on the free edition alone.

Running It

sonar-scanner \
  -Dsonar.projectKey=acme-api \
  -Dsonar.sources=src \
  -Dsonar.host.url=https://sonar.internal.acme \
  -Dsonar.qualitygate.wait=true

Maven and Gradle have dedicated plugins, and for Java, C#, and C++ the analysis should run as part of a real build so the analyser sees resolved types. Feed in coverage reports from your test framework rather than expecting SonarQube to generate them; it reads standard formats and reports on them but does not run tests.

The companion products are SonarQube for IDE, formerly SonarLint, which applies the same rules in the editor before the code is committed, and SonarQube Cloud for teams that prefer not to host.

Honest Positioning

SonarQube is excellent at what it was built for: keeping a large codebase consistent, measuring technical debt, enforcing standards on new code, and giving engineering managers a defensible view of quality over time. Rules map to CWE and the OWASP Top 10, so it produces useful compliance evidence.

As a security scanner it is a reasonable first layer and not a complete one. Deep interprocedural analysis with traceable paths is CodeQL’s territory; fast custom organisational rules are Semgrep’s; vulnerable dependencies need software composition analysis; and nothing static will find an authorisation flaw between two user roles. For that you need dynamic testing and a human. At Privia Security, we combine tool output with manual review in our web application security services.

FAQ – Frequently Asked Questions

Is SonarQube Free?

The Community Build is free, open source, and self-hosted, and it covers many languages with rule-based analysis. The Developer and Enterprise editions, plus a clustered edition for high availability, are commercial and add taint analysis for injection flaws, branch and pull request analysis, more language analysers, portfolio reporting, and support. The free edition is genuinely useful for code quality and distinctly limited for security.

What Is a Security Hotspot?

A piece of security-sensitive code that needs a human decision rather than an automatic verdict, such as a use of cryptography, randomness, or command execution. SonarQube does not count hotspots as defects; it asks a reviewer to mark each one safe or convert it to a vulnerability. Teams that never open the hotspot queue miss a large part of what the tool is telling them.

Does SonarQube Find Vulnerable Dependencies?

Not in the core product. It analyses the source code in your repository, not the third-party packages it pulls in. For known vulnerabilities in dependencies you need software composition analysis such as Dependabot, Renovate, Trivy, Grype, or a commercial platform. Running SonarQube alongside a dependency scanner is the normal arrangement, since they cover entirely different ground.

Should We Fail Builds on the Quality Gate?

Yes, provided the gate applies to new code only, which is the default profile. Blocking a merge because the lines just written introduce an issue, lack coverage, or contain an unreviewed hotspot is reasonable and keeps the codebase improving. Applying the same thresholds to an entire legacy application blocks everything and gets the gate disabled within a fortnight.

Related Terms

You May Be Interested In These

What Is a System Prompt Leak?

Cybersecurity Terms

17 November 2026

What Is a System Prompt Leak?

Read More
What Is Browser Forensics?

Cybersecurity Terms

17 November 2026

What Is Browser Forensics?

Read More
What Are Zones and Conduits?

Cybersecurity Terms

17 November 2026

What Are Zones and Conduits?

Read More