csonarqubecppdepend

How to add the custom rules of a single project to sonarQube analisys?


I created a new rule in my CPPDepend project. I can see that is been consider on the dashboard results as my 'TODO CUSTOM TEST CLASES'. (img below) I saved the project and added the .cdproj path to the CppDepend rules in sonarQube but I can not see any result related in SonarQube issues list.

2 QUESTIONS HERE;

To have a .cdproj will replace my quality profile created for the 'CPPDepend for C' rules that are activated for C? How to add the custom rules of a single project to sonarQube analisys , seems that those rules will be apply for all projects?

enter image description here


Solution

  • When you use CppDepend in Sonarqube you have to specify the cdproj file from the admin tab, this cdproj must contain all the rules you want to add to the SQ repository. This cdproj file is like a big database of all your rules, it's not specific to a project. However, when you do the analysis you specify the cdproj specific to your project

    sonar-scanner -D sonar.cpp.cppdepend.projectPath={the path of cdproj}

    To resume you have a .cdproj including all the rules and another one specific to your project.