SonarQube Setup
Connecting SonarQube lets FlightDesk surface code quality issues and security hotspots directly on each task. When issues are found, the review prompt tells Claude Code exactly what to fix.
Prerequisites
- A SonarQube Cloud account or self-hosted SonarQube server
- A SonarQube project already configured for your repository
- Admin access to configure webhooks in SonarQube
Step 1: Generate a SonarQube Token
In SonarQube:
- Click your avatar → My Account
- Go to the Security tab
- Under "Generate Tokens", enter a name (e.g. "FlightDesk") and click Generate
- Copy the token — you won't be able to see it again
The token needs at least Browse permission on the projects you want to connect.
Step 2: Connect in FlightDesk
- Go to Settings → Organization → Integrations
- Find SonarQube and click Configure
- Enter your SonarQube URL (e.g.
https://sonarcloud.ioor your self-hosted URL) and the token - Click Save
FlightDesk will test the connection immediately and surface an error if the credentials are invalid.
Step 3: Configure the Webhook in SonarQube
FlightDesk needs SonarQube to push results when a scan completes.
In your SonarQube project:
- Go to Project Settings → Webhooks
- Click Create
- Set the URL to
https://api.flightdesk.dev/webhooks/sonarqube - Set the Secret to your organization's webhook secret (find it on the FlightDesk integrations page)
- Click Create
For SonarCloud, webhooks can also be set at the organization level under Administration → Webhooks.
Step 4: Run the Scanner in CI
FlightDesk receives results via webhook — but SonarQube still needs to be triggered by your CI pipeline. Add a scan step that runs on pull requests.
Example for GitHub Actions with SonarCloud:
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Make sure your sonar-project.properties has the correct sonar.projectKey and sonar.organization.
How the Integration Works End-to-End
- PR opens → your CI runs a SonarQube scan
- SonarQube sends results to the FlightDesk webhook
- FlightDesk creates or updates a SonarQube check on the task
- The check shows issue counts; issues appear in the Review Prompt
- Claude Code reads the issues via FlightDesk's proxy, makes fixes, and pushes
- CI re-triggers the scan on the new push
- SonarQube sends updated results → check refreshes in FlightDesk
Check States
| State | Meaning | |---|---| | Passed | Zero issues, zero security hotspots | | Pending | Issues found — details in the review prompt | | Failed | Security hotspots present — these require human review |
Security hotspots are flagged as Failed rather than Pending because they require a human judgment call, not just an automated fix.
SonarQube Cloud Free Tier
SonarCloud is free for all public repositories. Private repository support is available on paid plans. Self-hosted SonarQube Community Edition is free with no feature restrictions for this integration.