i've got a problem analysing a solution containing C# and Cpp Projects using Jenkins, SonarQube and cppcheck.. The analysis of the C# Code is working totaly fine, all results (issues, code coverage etc.) are shown in Sonar.
The analyses of the C++-code with cppcheck is working fine - the results are shown in Jenkins via the the Cppcheck plugin but no output in sonar (not even the quality profile for cpp gets activated in the sonar project - that worked automaticaly in a test project i set up for test purposes).
The console output in jenkins gives me the following warning for each .cpp, .h, .vcxproj file:
WARNING: File is not under the project directory and cannot currently be analysed by SonarQube. File [filepath]
The files are definitely located in the filepaths listed after these warnings and they are during the analysis (no copying/moving of files in the build jobs).
I already read this post and made sure that i've got no occurence of "Test" in my paths. I also made sure that the files i want to analyse are no shared files.
I hope anybody has some ideas what is getting wrong here - i haven't got a clue why sonar does not want to show my cppcheck-results.
My system:
Best regards
Akki
I'm currently developing a SonarQube plugin for importing PVS-Studio static analysis results and I have faced the same problem. The message you have mentioned is produced by MSBuild.SonarQube.Runner and means that the source file under analysis is located higher in the directory tree than the .vcxproj file, for example:
sourceFile.cpp
projectDirectory
|
---project.vcxproj
As far as I understand, MSBuild.SonarQube.Runner assumes that all source files should be located under the directory where the .vcxproj file exists, and ignores all the files that doesn't satisfy this condition.
Since it's not possible to alter the way MSBuild.SonarQube.Runner determines project's base directory, and you still need to analyze those skipped files, I suggest you use the default SonarQube scanner, create the sonar-project.properties config file as described here: SonarQube Scanner, and use the sonar.sources property to specify paths to source files.