Gitar

Better together: Gitar and SonarQube

This course explains why SonarQube's rule-based analysis and Gitar's context-aware review work together as complementary layers of code verification, rather than one replacing the other. Through a worked example, it shows how Gitar catches intent-based flaws that pass SonarQube's checks, then drafts and verifies a fix — closing the loop from detection to a merge-ready solution.

Transcript

You've already rolled out SonarQube. It checks every pull request against your quality gate. So why do you need Gitar? Because reviewing massive amounts of AI-generated code requires two layers of verification— algorithmic and agentic—and you need both. The first layer is algorithmic verification. SonarQube checks your code the same way every time, on every commit. It reads your code, breaks it into pieces it can analyze, and traces how data moves through your program from start to finish. It also checks your code against a deep library of known vulnerability and bug patterns. This approach is repeatable by design. Every run is auditable and explainable. Give it the same code twice, and you get the same result twice. But this layer has a limit: it can't read intent. It sees what the code does, not what it was supposed to do. The second layer is agentic verification. This is where Gitar comes in. It reads your standards, reads the pull request, and reviews it with context. It can catch a flaw in logic even when the code breaks no known pattern. The tradeoff: agentic review isn't exactly the same on every scan. Ask it to review the same PR twice, and the wording may differ slightly, but the judgment holds. That's why it works best paired with SonarQube, not instead of it. Think of multi-layer verification like slices of Swiss cheese. Each layer has its own gaps, but stack them together and the holes rarely line up. SonarQube's algorithmic checks catch the majority of issues, every time, with full confidence. Gitar catches what that first pass can't see: the gap between code that's technically correct, and code that actually does what you meant it to do. Let's make this concrete. Say an AI agent opens a PR for a feature that adds threaded replies to an in-app conversation feature. To keep things simple, each reply is stored as one block of text, with a small divider after it that tells the app "a new reply starts here.” SonarQube scans the PR and comes back clean. There's no SQL, no HTML, and nothing else matching a known vulnerability pattern, so nothing flags, and the code passes the scan. But there's still a problem: the app has no way to tell its own divider apart from a user simply typing that same divider into their note. If a user types it themselves, the app reads it as a real divider— letting them forge a fake reply that looks like it was posted at any time they choose. Gitar catches this on review. It understands what the divider is for, spots that user input can be mistaken for it, and drafts a fix so that can't happen. One click, and the fix is applied. That's the value of better together— SonarQube sets the code standard and catches issues; Gitar reviews the context and fixes it instantly, closing the loop from detection to a verified fix. Ready to get started? Install Gitar in under five minutes at gitar.ai.