SonarQube
Code quality and security platform with static analysis (SAST) for 30+ languages.
Pricing
Freemium
Type
Automation
Community
// VERDICT
Reach for SonarQube when you want continuous SAST plus code-quality analysis wired into CI, with a self-hostable option. Skip it when you need DAST against a running app, dependency scanning, or a security-only specialist tool.
Best for
Continuous static analysis of code quality and security - scanning source for bugs, code smells and vulnerabilities (SAST), with a self-hostable server and strong CI integration.
Avoid when
You want dynamic runtime scanning (DAST), dependency-only scanning, or a pure security tool without the code-quality breadth.
CI/CD fit
SonarScanner · GitHub Actions · GitLab CI · Jenkins · Azure DevOps
Team fit
Dev teams · DevSecOps · Teams wanting quality + security gates
Setup
Maintenance
Learning
Licence
// BEST FOR
- Static analysis of source for bugs, code smells and vulnerabilities
- Continuous quality/security gates enforced on every pull request
- Self-hosting the server for control over code and data
- Tracking code quality and security debt over time
- Broad language coverage in one tool
- Failing the build when new code crosses a quality/security gate
// AVOID WHEN
- You need dynamic testing of a running app (DAST - ZAP/Burp)
- You want dependency/SCA scanning as the focus (Snyk)
- You want a security-only tool without code-quality breadth
- A specialist deep SAST engine is required (Checkmarx/Veracode)
- You can't host or manage a server (though SonarCloud exists)
- You want zero setup and no CI wiring
// QUICK START
# Run a SonarQube server (Docker), then scan from your project:
docker run -d -p 9000:9000 sonarqube:community
sonar-scanner -Dsonar.projectKey=my-app -Dsonar.host.url=http://localhost:9000// ALTERNATIVES TO CONSIDER
| Tool | Choose it when |
|---|---|
| Checkmarx | You want a deeper, specialist commercial SAST engine. |
| Veracode SAST | You want cloud-based SAST with strong compliance reporting. |
| Snyk | You want dependency/SCA scanning rather than full code analysis. |
// FEATURES
- SAST scanning for 30+ languages
- Code smell, bug, and vulnerability detection
- Quality gates that fail PRs on regressions
- SonarLint IDE extension for inline hints
- Branch and pull-request analysis
- SonarCloud SaaS or self-hosted Server/Enterprise
// PRIMARY USE CASES
CONTINUOUS CODE QUALITY
Run static analysis on every PR to catch bugs, code smells, and security issues before merge.
TECH-DEBT TRACKING
Quantify code smells across a codebase and track payback as teams remediate them.
REGULATORY COMPLIANCE
Enforce coding standards (CWE, OWASP, MISRA) and gate releases on quality thresholds.
// PROS
- Mature ruleset across many languages
- Quality gates enforce standards in CI
- Strong PR-based workflow
- Community Edition free and self-hostable
// CONS
- Many languages and advanced rules behind paid editions
- Resource-heavy server install
- Rule tuning needed to reduce noise on legacy code
- False-positive rate varies by language
// EXAMPLE QA WORKFLOW
Stand up a SonarQube server (self-hosted or SonarCloud)
Configure quality gates and rulesets
Wire the SonarScanner into the build
Analyse code on each pull request
Fail the build when new code crosses a gate
Triage findings and track quality/security debt
// RELATED QA.CODES RESOURCES
Cheat sheets
Practice
Interview