SynfraCore
Synfracore
Start Learning
Navigation

Academies

Platform

RoadmapsLabsCertificationsInterviewPYQsAI AssistantCareer
Start Learning Free Learning Roadmaps

SonarQubeNotes

Key takeaways, tips, and important points to remember

📄
Last updated Aug 2026
Expert Content

SonarQube Key Notes

Issue Types Quick Reference

TypeMeaning

|---|---|

BugCode likely to produce incorrect behavior
VulnerabilityA security weakness with known exploitation risk
Code SmellMaintainability concern, not strictly incorrect
Security HotspotSecurity-sensitive pattern requiring human review

Severity Levels

BLOCKER > CRITICAL > MAJOR > MINOR > INFO

Core Architecture

ComponentRole

|---|---|

SonarScannerRuns the actual code analysis, produces a report
SonarQube ServerReceives reports, stores results, serves UI/API
Compute EngineServer-side: processes uploaded reports from a queue
DatabaseAuthoritative data store
Elasticsearch (embedded)Search/indexing for the web UI

Quality Profile vs. Quality Gate

Quality Profile — WHICH rules run, at what severity (per language/project)
Quality Gate    — WHAT COMBINATION of results = pass/fail

Default Gate ("Sonar way"), scoped to New Code

0 new Bugs
0 new Vulnerabilities
Security Hotspots reviewed
Coverage on New Code >= 80%
Duplicated lines on New Code < 3%

New Code Definitions

Previous version        — since the last release/tag
Number of days           — e.g. last 30 days
Reference branch          — diff against main/baseline (clearest for
                             feature-branch workflows)

Scanner Invocation Quick Reference

bash
sonar-scanner -Dsonar.projectKey=<key> -Dsonar.sources=. \
  -Dsonar.host.url=<url> -Dsonar.login=<token>

# PR analysis
-Dsonar.pullrequest.key=<n> -Dsonar.pullrequest.branch=<branch> \
  -Dsonar.pullrequest.base=main

# Branch analysis
-Dsonar.branch.name=<branch>

# Coverage import (example: JaCoCo)
-Dsonar.coverage.jacoco.xmlReportPaths=<path>

Security Hotspot States

TO_REVIEW    — flagged, awaiting human judgment
ACKNOWLEDGED — confirmed real risk, needs a fix
SAFE          — confirmed not exploitable in context, documented

Product Comparison

ProductFeedback PointHosting

|---|---|---|

SonarLintReal-time, in IDE, before commitLocal, optionally connected
SonarQubeAfter analysis (CI-triggered/on-demand)Self-hosted
SonarCloudAfter analysisSonarSource-hosted SaaS

Key Gotcha: 0% Coverage

SonarQube does NOT run tests itself -- it IMPORTS a coverage
report the project's own tooling generated. 0% coverage almost
always means the report wasn't generated or the path is
misconfigured, not that tests genuinely don't exist.
Share:
Join our Community
Daily tips, job alerts, interview help — join engineers learning together
Up Next
📝
SonarQubePYQ
Previous Year Questions with detailed solutions
Also Worth Exploring
← Back to all SonarQube modules
CheatsheetsPYQ