SonarQube and Verification
Last updated: 2026-11-038 min read
Sources checked 2026-11-032 sourced figures
Static analysis checks whether code is sound by rule: bugs, code smells, security issues and maintainability signals that static rules can recognise in the source. It does not check whether a change did what its task said, stayed within its scope and carries evidence that a human reviewed it. SonarQube answers the first question with analyzers, quality profiles and a quality gate; the second needs task-relative verification, a check whose reference lies outside the code. A green gate answers the first question only.
Contents
Two questions, and which one SonarQube answers
The frame above is the site’s own, taken from the verification-debt comparison table, where static analysis has a row of its own: what it catches, what it leaves open. The first question is about the code as written. Does this function leak a resource, does that branch dereference a null, is this string concatenated into a query, has a block been duplicated. Each of these has a rule, and a rule can be run over any source tree without knowing why the tree changed.
The second question is about the change as an act. Did it do what the task asked, did it stay inside the scope the task allowed, and is there evidence that someone checked it before it was merged. None of these has a rule, because the task is not in the source tree. A renamed field, propagated cleanly through every call site, passes every rule and is still the wrong change if the task asked for a migration. The reference for that judgment sits outside the code, in the written task and its acceptance criteria.
SonarQube is built for the first question and is good at it: a deterministic rule set, a configurable gate and a result that can be reproduced from the same source. That is also why it cannot take over the second question. A tool that reads only the repository has no way to learn that the repository was supposed to look different. The rest of this page keeps the two questions apart, places Sonar’s documented features against the first, and shows what the second needs instead.
What SonarQube documents
Sonar’s Server documentation for 2026.5 describes project analysis as a scanner installed on the CI host, run over an analysis scope set by parameters, with SCM data imported from the repository and results reported to the server (checked 3 November 2026). Its AI Code Assurance standards work in three steps: label a project as containing AI-generated code, apply a quality gate qualified for AI code, publish a badge with the gate status (checked 3 November 2026). The built-in gate, Sonar way for agentic AI, replaces the legacy Sonar way for AI Code gate and sets conditions on new code only, among them coverage of at least 80 percent and duplication of at most 3 percent (checked 3 November 2026).
A companion Sonar agentic AI quality profile recalibrates the rules around six risk categories for Java, JavaScript/TypeScript and Python (checked 3 November 2026). Sonar frames these within an Agent Centric Development Cycle of three loops, an agentic loop, a CI verification loop around analysis and gate, and a maintenance loop, several of them separate subscriptions on the Enterprise and Data Center editions (checked 3 November 2026). Exact capabilities depend on product, edition, version and configuration; this comparison ran no SonarQube instance.
Why the second question needs a reference outside the code
Everything in the previous section answers the rule question, and Sonar’s own framing confirms the boundary: a gate “passes or fails” conditions on code, and what it verifies is the code against those conditions. Even the loop that carries the word verification in its name verifies code against standards. The task that produced the code is not an input to any of it.
Task-relative verification supplies that missing input. It takes the written task with its scope and acceptance criteria, the observed change and the evidence from the checks that actually ran, and records whether they match. Its output is not a rule finding but a bounded statement: this change, against this task, with these commands observed, matched or deviated here. That is the check the site calls AI coding verification; its delineation against code review is drawn on its own page, and the delineation against static analysis is the same move with a different neighbour.
Two consequences follow. First, the two checks reinforce one decision without substituting for each other: a green gate on a change that failed its task check is a well-formed wrong change, and a task check that passed on code with an open injection finding is a correct change you should not ship yet. Second, each check has a failure mode the other cannot see. Rules miss intent; a task check misses whatever the task forgot to ask for, and it is only as good as the task and the checks you selected. The table below places both among the other evidence layers a merge decision draws on, each with the question it answers and the boundary it keeps.
A quick way to sort any finding or check into one of the two questions:
- If the same result would come out of the same source tree no matter what the task said, it answers the rule question.
- If the result changes when the task changes while the code stays the same, it answers the task question.
- If the result needs the deployed system to exist, it belongs to neither and is runtime evidence.
- If the result depends on who looked and when, it is review or governance evidence: it records a decision, not a property of the code or the change.
Sorted this way, a tooling discussion stops being a contest. Each layer gets the question it can answer, and the gaps between the layers become visible instead of being covered by the loudest green badge.
Do not collapse rules, gates, review, verification, and runtime proof
A rule finding reports what one configured analyzer recognised. A quality gate computes whether configured conditions were met. Human review adds accountable context and judgment. Task-relative verification compares a change with its declared scope and acceptance. Governance evidence records who authorised what and what was observed at a revision; runtime evidence records what the deployed system did. A pass in one layer does not silently answer the others.
Take one change: an agent adds a retry loop to a payment client. The analyzer flags nothing new, the gate passes, a reviewer approves the structure. The task asked for idempotent retries; the loop re-sends the request without an idempotency key. Every layer did its job, and only the task check, with the task in hand, records the gap. Governance evidence then records who approved what; runtime evidence later shows duplicate charges, or does not. Six records, one decision, and no layer able to stand in for another.
Compare evidence layers by the question they answer
| Primary question | Typical evidence | Boundary | |
|---|---|---|---|
| Static analysis | What issues or metrics do configured analyzers report for the selected source scope?Evidence-layer question · 2026-11-03Teams can combine or extend layers in their own workflow. | Scanner configuration, quality profiles, issues, metrics, and versionTypical artifactExact artifacts depend on configuration and process. | Does not by itself establish task intent, runtime behavior, or complete defect absenceClaim boundary · 2026-11-03No cross-layer pass is inferred. |
| Quality gate | Did the computed measures satisfy the configured gate conditions?Evidence-layer question · 2026-11-03Teams can combine or extend layers in their own workflow. | Gate definition, branch or new-code context, computed result, and exceptionsTypical artifactExact artifacts depend on configuration and process. | A pass is scoped to those conditions; it is not certification or universal code assuranceClaim boundary · 2026-11-03No cross-layer pass is inferred. |
| Human review | Are design, trade-offs, maintainability, risk, and context acceptable to accountable reviewers?Evidence-layer question · 2026-11-03Teams can combine or extend layers in their own workflow. | Comments, approvals, requested changes, decisions, and reviewer contextTypical artifactExact artifacts depend on configuration and process. | Coverage and judgment vary; approval is not runtime proofClaim boundary · 2026-11-03No cross-layer pass is inferred. |
| Task-relative verification | Does the observed change and validation evidence match the declared task, scope, and acceptance criteria?Evidence-layer question · 2026-11-03Teams can combine or extend layers in their own workflow. | Mission boundary, changed files, tests, receipts, deviations, and operator decisionTypical artifactExact artifacts depend on configuration and process. | Depends on the quality of the task and selected checks; it is not static analysis or runtime monitoringClaim boundary · 2026-11-03No cross-layer pass is inferred. |
| Governance evidence | Who authorized what, which checks ran, and what was observed at a specific revision?Evidence-layer question · 2026-11-03Teams can combine or extend layers in their own workflow. | Approval, commit identity, validation receipts, proof, and transition historyTypical artifactExact artifacts depend on configuration and process. | Traceability does not make the underlying code correct or secureClaim boundary · 2026-11-03No cross-layer pass is inferred. |
| Runtime evidence | What happened in the deployed environment under observed traffic and configuration?Evidence-layer question · 2026-11-03Teams can combine or extend layers in their own workflow. | Deployment provenance, telemetry, incidents, traces, logs, and live checksTypical artifactExact artifacts depend on configuration and process. | Observed runtime windows do not cover every future input or conditionClaim boundary · 2026-11-03No cross-layer pass is inferred. |
Where Reality Graph fits
Reality Graph sits beside SonarQube, build and test systems, code review, and runtime tooling. It binds one AI coding run to a mission scope, allowed paths, validation commands, captured receipts, changed files, approval, and commit identity. It does not implement Sonar analyzers or quality profiles, discover every vulnerability, replace reviewers, or observe production unless deployment and live evidence are explicitly captured. The relevant question is which evidence layers a decision needs-not which tool wins a universal contest. Whether the declared commands actually ran or were only reported as run is recorded separately from what any analyzer concluded. See also code review versus verification.
This comparison can show
- Which Sonar analysis and AI-qualified-gate features its current public documentation describes
- How static-analysis, gate, review, verification, governance, and runtime evidence answer different questions
- Where Reality Graph can preserve task-scope, validation, approval, and revision evidence beside existing tools
It does not establish
- That either product is categorically superior, complete, endorsed by the other, or suitable for every team
- That Reality Graph replaces SonarQube, static analysis, testing, review, monitoring, or security assessment
- That a badge, gate pass, governed receipt, or live check is certification, compliance, or universal runtime proof
FAQ
- What does SonarQube Server analyze?
- The code against rules, never the task. Everything the scanner reports is a property of the source as written: a rule recognises a pattern or it does not, and the same tree gives the same answer whatever the task said. Sonar's Server documentation for 2026.5 describes that scanner on your CI host, run over the configured scope with the active quality profile, reporting issues, measures and a gate status (checked 3 November 2026). The task that produced the change is not an input, so nothing in the output says whether the change was the right one.
- What is AI Code Assurance in SonarQube Server?
- A way to mark and gate projects that contain AI-generated code, with a badge that reports the gate status. Read the badge as what it is: the outcome of configured conditions on new code, not task conformance, not runtime behaviour, not a certification. Sonar's documentation names the three steps, label the project, apply a quality gate qualified for AI code, publish the badge, and a built-in gate called Sonar way for agentic AI (checked 3 November 2026). A custom gate can be qualified too, which is one more reason to record which gate a status came from.
- Is static analysis the same as task-relative verification?
- No, and the difference is the reference. Static analysis compares code with rules; its reference is inside the toolchain. Task-relative verification compares an observed change and its validation evidence with the written task, scope and acceptance criteria; its reference is outside the code. The two can read the same files and still answer different questions, which is why a green gate on the wrong change is still the wrong change.
- Does Reality Graph replace SonarQube?
- No. Reality Graph is positioned beside static analysis, tests, review, and runtime controls. It binds a coding run to declared scope, selected validation, captured receipts, and an operator decision. It is not SonarQube's rule engine, a vulnerability scanner, a runtime monitor, or a substitute for human judgment.
- What evidence should a team retain across both workflows?
- One record per question. For the rule question: the SonarQube version and edition, the analysis scope, the quality profile, the gate definition and its outcome at that revision. For the task question: the written task and its scope, the changed files, the commands that ran and their observed results, the deviations and who decided. Keep both next to the same commit identity, so an auditor can ask either question later and get the artefact that answers it, not the one that merely looks related.
Keep reading
Sources
- SonarQube Server documentation (2026.5) - project analysis setup: scanner on the CI host, analysis scope, SCM and CI integration (checked 2026-11-03)
- SonarQube Server documentation (2026.5) - Standards for AI Code Assurance: project label, AI-qualified quality gate, badges (checked 2026-11-03)
- SonarQube Server documentation (2026.5) - Sonar way for agentic AI quality gate: conditions on new code (checked 2026-11-03)
- SonarQube Server documentation (2026.5) - Sonar agentic AI quality profile: risk categories and languages (checked 2026-11-03)
- Sonar documentation - Agent Centric Development Cycle: the three loops and their subscription requirements (checked 2026-11-03)