-
Notifications
You must be signed in to change notification settings - Fork 363
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
c++ community can't extract msbuild warnings for SonarQube #1184
Comments
@VallotLuc some questions:
Regards, |
Hi guwirth, SQ : 6.4 thanks for the link, the problem is solved One related question : regards Luc |
@VallotLuc good to hear. Our settings are documented here: https://github.com/SonarOpenCommunity/sonar-cxx/wiki/Supported-configuration-properties |
Thanks Günter, thanks Luc |
Please read discussion #616. There you find a sample properties file for visual studio 'SonarQube.StaticAnalysis.props'. Here I use <SQCompilerRegEx>^(.*)\((\d+)\)\x20*:\x20warning\x20(C\d+):\x20(.*)\x20\[$(SQProjectFile)\]$</SQCompilerRegEx> and a message shows the regular expression: <Target Name = "SQEnvCheck" AfterTargets="Build">
<Message Text="sonar.cxx.compiler.regex = $(SQCompilerRegEx)"/>
</Target> |
thanks for the syntax, I have a related question my msbuild.log file contain duplicates warning lines (same file, same line , same warning-code), is it possible to force Msbuild to generate the same value, or is it possible to write a script to replace the path by a normalized one ? regards Luc |
I think the second path is not correct and the plug-in does not handle the relative path starting with '..\' correctly. So this issue has to be solved in the C++ community plug-in. The usage of "../calcul/Types.h" is a bad practice and shall be avoided anyway. |
Hi,
I want export warning from c++ msbuild.log file to sonarqube, using c++ community plugin,
after exporting, sonarqube has no result except duplications informations
I'm using this process
SonarQube.Scanner.MSBuild.exe begin /k:"LV" /n:"LV" /v:"1.0" /s:"C:\Program Files (x86)\Jenkins\workspace\sonarqube.analysis.xml" /d:sonar.cxx.compiler.regex="^.>(?.)((?[0-9]+)):\x20warning\x20(C\d\d\d\d):(?.*)$"
"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" /t:Clean,Build /p:PlatformToolset=v140 /p:Configuration=Release;WarningLevel=3 /p:RunCodeAnalysis=True;CodeAnalysisRuleSet=AllRules.ruleset;verbosity=normal /filelogger /fileLoggerParameters:Verbosity=detailed;Encoding=UTF-8
SonarQube.Scanner.MSBuild.exe end
the end process display this
INFO: Sensor CxxCompilerSensor [cxx]
INFO: Searching reports by relative path with basedir 'C:\Program Files (x86)\Jenkins\workspace\Test_C' and search prop 'sonar.cxx.compiler.reportPath'
INFO: Scanner found '1' report files
INFO: Parser will parse '1' report files
INFO: Processing report 'C:\Program Files (x86)\Jenkins\workspace\Test_C\msbuild.log'
INFO: Scanner 'Visual C++' initialized with report 'C:\Program Files (x86)\Jenkins\workspace\Test_C\msbuild.log', CharSet= 'UTF-8'
INFO: Parsing 'Visual C++' format (UTF-8)
INFO: Using pattern : '^.>(?.)((?[0-9]+)):\x20warning\x20(C\d\d\d\d):(?.*)$'
INFO: C++ compiler Warnings processed = 0
INFO: Sensor CxxCompilerSensor [cxx] (done) | time=359ms
as you can see, no warnings are processed, but why ? , the msbuild.log contain many
I'm using c++ plugin 0.9.7 and all rules are activated
msbuild.log and qonarqube.analysis.xml in this zipfile
SonarQube.Analysis.zip
Can you help me ?
Best regards
Luc
The text was updated successfully, but these errors were encountered: