SonarQube Standalone Integration


IMPORTANT:
  • This documentation concern the full C/C++ SonarQube integration. In this case no need to install any SonarQube C++ plugin to parse your source code.
    In case you use another C/C++ SonarQube plugin and you want to only import the CppDepend issues, please refer to the documentation of the light SonaQube integration.
  • To run CppDepend on a machine you need first to activate your licensing or your evaluation period.
    To do so, once CppDepend files unzipped on the machine, just run once VisualCppDepend.exe. You'll go through a few seconds activation procedure if the machine is connected to internet.
    If the machine is not connected to internet, an offline activation procedure will be proposed instead, and must be fulfilled in order to run the SonarQube CppDepend plugin.
  • The CppDepend SonarQube plugin supports SonarQube version 5.6 and higher.

Getting Started Video


C/C++ Plugin Prerequisites
Plugin installation and configuration

  • Copy the sonar-cxx-plugin-cppdepend-1.0 from $CppDependInstallDir$/SonarPlugin to the $SonarQubeInstallDir$\extensions\plugins directory and restart SonarQube.

  • The default CppDepend rules are loaded to the SonarQube rules repository. However, if you need to customize these rules you can define your own custom rules using the .cdproj file path located under the SonarQube Administration Tab.


  • You have to log in as an admin and activate the CppDepend rules in the profile you want.



  • Execute $CppDependInstallDir$/SonarRunnerForCppDepend.exe "the .cdproj file to analyze "

    For example: SonarRunnerForCppDepend.exe C:\MyWorkspace\test.cdproj.
    SonarRunnerForCppDepend will analyze the cdproj file using CppDepend and launch the SonarQube Scanner executable to load the results into SonarQube.
    Any other argument passed to the SonarRunnerForCppDepend after the cdproj file argument will be passed to the SonarScanner command.
    For example you can pass the version with this command SonarRunnerForCppDepend.exe C:\MyWorkspace\test.cdproj -Dsonar.projectVersion=3.0

Plugin features

  • Multi Module analysis: a CppDepend project could contain many C/C++ projects.
    After the analysis, CppDepend does not put all the code in the same SonarQube module. However, it creates a multi module sonarqube project to isolate each project into a separate module which makes the code navigation very easy.



  • Issues: CppDepend provides by default more than 250 rules, which you can easily customize completely.
    CppDepend provides a powerful way to compute the technical debt of the issues. The CppDepend technical debt and the issue severity are given to SonarQube.



  • Standard metrics: the plugin calculates all the standard SonarQube metrics.



  • Code duplication: The duplications are detected by the CPD tool embedded in SonarQube.



  • Coverage: The plugin loads the coverage result from Cobertura and Microsoft Visual Studio XML result files.
    However, you have to set the path where the xml coverage files exist.





CppDepend offers a wide range of features. It is often described as a Swiss Army Knife for C and C++ developers.

Start Free Trial
.