SonarQube is a static analysis platform that inspects source code for bugs, security vulnerabilities and code smells, and can fail a pull request through a quality gate. The Community Build is free and self-hosted; SonarQube Cloud is free for public repos, with paid tiers from about $32/month.
What is SonarQube?
SonarQube reads your code without running it and scores it against a rule set of more than 6,000 checks across 30-plus languages. It is made by SonarSource, a Swiss company, and has been around since 2008 — long enough that most CI pipelines have a plugin for it.
The thing that separates it from a linter: a project-level quality gate on new code. If the new code has a vulnerability rating worse than A or coverage under your threshold, the PR fails. That turns code review from opinion into a policy.
Which SonarQube edition should you pick?
- Community Build — free, self-hosted, Java/JVM plus 20+ languages, no branch analysis. Fine for a small team on one branch.
- SonarQube Cloud (Free) — free for public GitHub/Bitbucket repos, unlimited lines.
- SonarQube Cloud (Team) — starts around $32/month for 100k lines of private code.
- Developer Edition — branch analysis plus PR decoration, priced by lines of code from roughly $150/year at small volume.
- Enterprise — portfolio management and security reports for large orgs.
Product Features
- Quality gates — pass/fail on new code, enforced in the CI pipeline.
- Security hotspots — flags risky patterns like weak crypto for a human to review.
- Taint analysis — tracks untrusted input from source to sink for SQL injection and XSS on paid editions.
- Coverage import — reads JaCoCo, Istanbul, Cobertura and lcov reports from your existing tests.
- SCM blame — shows which author introduced each issue and when.
- IDE plugins — SonarLint in VS Code and IntelliJ mirrors the server rules.
Product Highlights
- Free Community Build is genuinely useful, not a crippled demo.
- New-code-only gating lets legacy codebases adopt it without a 10,000-issue backlog block.
- SonarLint in the editor catches most issues before you push.
- Rules are public and documented, so you can argue with a specific rule by ID.
Who should use it, and what are the weak spots?
Solid fit for teams that need a compliance-ish baseline — PCI or SOC 2 reviewers like seeing a quality gate. Also good for polyglot repos where a single tool must cover Java, TypeScript, Python and Go.
The honest downsides. Self-hosting Community Build means an Elasticsearch-backed server you have to patch and tune, and it gets slow past a few million lines. Branch analysis, which most teams consider essential, is locked behind Developer Edition. And the rule set is stricter than most teams want — expect a week of triage on first scan.
If you want AI code review comments rather than rule-based findings, tools like CodeRabbit or Greptile target a different job. SonarQube does not try to write suggestions about your logic.
Where SonarQube fits day to day
- Blocking PRs that drop coverage below 80% on new code.
- Finding hardcoded credentials and weak crypto before a security review.
- Giving a legacy monolith a measurable baseline before a rewrite.
- Enforcing a rule set on a 40-developer org through CI, not code review habits.
- Feeding code metrics into an engineering health dashboard.
Quick Summary
- SonarQube is static analysis for 30+ languages with pass/fail quality gates on new code.
- Community Build is free and self-hosted; Cloud Team starts near $32/month.
- Branch analysis and PR decoration require the paid Developer Edition.
- Best for polyglot teams that need enforced, auditable code quality standards.