Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CppCheck file list when using SonarQube Scanne for MSBuild #1336

Closed
taalas opened this issue Nov 22, 2017 · 4 comments
Closed

CppCheck file list when using SonarQube Scanne for MSBuild #1336

taalas opened this issue Nov 22, 2017 · 4 comments
Labels

Comments

@taalas
Copy link

taalas commented Nov 22, 2017

Hi,
I am currently trying to integrate CppCheck analysis for a Visual Studio project using a TFS Build Agent. The runner is called via a "SonarQube Scanner for MSBuild" task and generates file lists from VS solution and project files (not using a sonar-project file).
The instructions to integrate CppCheck into the analysis state to make sure, that the files to analyse match the ones in the sonar project. Since those are dynamically generated from the solution files I don't have access to what is analyzed though. What is the correct way to generate the CppCheck results in this case?
Thanks!

@guwirth
Copy link
Collaborator

guwirth commented Nov 22, 2017

Hi @taalas,

Don't have experience with TFS Build Agent but maybe @Bertk can help you?

Point is that file path on system you are running the scanner must match with the path inside of the Cppcheck report. I guess that you have to integrate the Cppcheck tool somehow into the TFS build chain? Others are patching the paths inside the report with a search & replace tool.

https://github.com/SonarOpenCommunity/sonar-cxx/wiki/Path-and-path-separator-issues

Regards,

@taalas
Copy link
Author

taalas commented Nov 22, 2017

Hi @guwirth,
thanks for taking the time to answer.
I have found a solution for the file list. cppcheck can read VS solution and project files now (for some reason I had missed that completely). When using those the evaluated files should match those from the SonarQube runner. I still have some problems with cppcheck not producing the sames results as locally (when called on the agent), but that is most likely unrelated to this issue.
Sorry for the confusion.

@taalas taalas closed this as completed Nov 22, 2017
@Bertk
Copy link
Contributor

Bertk commented Nov 23, 2017

@taalas Maybe this helps for analysis tool integration. Please check:

@taalas
Copy link
Author

taalas commented Nov 23, 2017

@Bertk That looks very interesting indeed, thanks!

Is it possible to only include these additional props when building on a TFS agent? Sorry if this should be trivial, I just recently started to use this environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants