- Download SonarQube from SonarQube.org.
- Unpack the distribution.
- Download the C++ community plugin.
- Install the plugin using these instructions.
- Run
bin\windows-x86-64\StartSonar.bat
to start the server. - Wait for the server to output the message
SonarQube is up
. - Browse to
http://localhost:9000
and login withadmin
/admin
. - Create a project by following the built-in tutorial.
- Configure the scanner for C++
- Project properties
- Login credentials
- C++ Language
- build log reports
- cppcheck reports
- Configure cppcheck to output XML version 2 report (
--xml-version=2
)
- Configure cppcheck to output XML version 2 report (
- Activate Quality Rules
- Make a copy of the "C++ (Community) Sonar way" Quality Profile and name it for your project
- Activate rules in the new quality profile
- cppcheck rules
- MSVC compiler rules
- clang-tidy rules
- Project properties
- Run an analysis.
- Perform a build
- /analyze for MSVC static analyzer
- scan-build for clang static analyzer
- cppcheck
- Run sonar-scanner
- Perform a build
- Browse the results.
- Iterate by enabling or disabling checks in your quality profile and re-running sonar-scanner
- Integrate to your CI build to track trends
- Open Source projects can use SonarCloud.io
-
-
Save ictus4u/7d8c4a2cb604ec4e0af92a1936411f8c to your computer and use it in GitHub Desktop.
SonarQube Configuration for C++ Projects
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment