Hi everyone,
If you write Ada code or manage embedded/safety-critical projects, you probably know that official SonarQube support for Ada is restricted to commercial/enterprise tiers.
To bridge this gap for open-source projects, personal setups, and teams running SonarQube Community Edition, I’ve built an open-source integration pair: AdaLang_Analyzer and SonarAdaPlugin.
What it does
-
AdaLang_Analyzer: A standalone static analysis tool built on top of Libadalang. It parses Ada codebases to detect common logic errors, dead code, control flow anomalies, and style issues.
-
SonarAdaPlugin: A community plugin for SonarQube that adds native language support for
.adband.adsfiles, imports the analysis results into your SonarQube dashboard, and maps them to standard Sonar metrics (bugs, code smells, debt).
Quick Start & Integration
1. Generate the Analysis
Run the analyzer against your source code to produce the report:
Bash
adalang_analyzer --source-dir ./src --output-format json --output-file report.json
2. Configure sonar-project.properties
Add the following properties to your SonarScanner configuration:
Properties
sonar.projectKey=my-ada-project
sonar.projectName=My Ada Project
sonar.sources=src
sonar.language=ada
sonar.ada.reportPaths=report.json
3. Run SonarScanner
Execute sonar-scanner as usual. The plugin will parse the generated report and display your Ada code quality directly inside SonarQube.
Repositories & Contributions
-
Analyzer Repository: mmartign/AdaLang_Analyzer
-
Sonar Plugin Repository: mmartign/SonarAdaPlugin
Both projects are open-source and actively maintained. If you test it out on your projects, I’d love to get your feedback, bug reports, or rule suggestions!