Search code examples
sonarqubecppcheck

How to get cppcheck-results into SonarQube


We use cpp-check and SonarQube 6.0 and want to inject the results of cppcheck into the system. Cppcheck runs fine and produces an xml-file with results. However Cpp-check and SonarQube are not running on the same machine.

Is it sufficient to set something in Administration > C++(Community) > CodeCode analysis > Cppcheckreports ?

We put the name of the xml into that field - but how should SonarQube find that? What are we missing here?


Solution

  • SonarQube and Cppcheck don't have to run on the same machine. But the Cppcheck report does need to be available to the analysis. If you can't run analysis on the machine where Cppcheck runs, then you just need to set up some process (FTP? Sneakernet?) to get the file where it needs to go.

    This all assumes you have the Cppcheck plugin installed in SonarQube, as well as some plugin, such as SonarC++($), which declares the language.

    2023 Edit C++ analysis is available in all commercial editions of SonarQube, and on SonarCloud, which is free for open source projects