-
Notifications
You must be signed in to change notification settings - Fork 360
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
SampleProject2 sample does not report cppcheck 1.63 errors in SonarQube 4.2 #191
Comments
You need ./ in each file. So ./src/ See #102 it should already be fixed in head
|
After modification of the generated cppcheck XML report as indicated, the sonar-runner analysis report cppcheck reports effectively. Thanks for the reference. I knew that I had missed something. Maybe, a doc. or script in the SampleProject2, should be helpfull because in the current state it does not work completely automatically. Thank you. |
If you get latest and compile, this should be fix. @wenns made the fix 2 days ago. Do you mind trying it? |
Ok, I am going to try it. |
With the latest delivery, I confirm that the SampleProject2 passes automatically. There is no need to modify cppcheck XML report. Bravo. |
great |
Hello,
I should miss something important because I don't manage to run the SampleProject2 sample provided by the Cxx plugin.
Environment:
Cxx plugin 2014-04-18 (https://github.com/wenns/sonar-cxx/archive/631e2e7a601540375bee7d71a849c8dcf884d206.zip)
For testing purpose, I have copied the sonar-cxx-plugin/src/samples/SampleProject2 into
/data/sonarqube/cxx/SampleProject2. Then I have modified in the
sonar-project.properties file the "sonar.cxx.include_directories" property
in order that Cxx can find the include files in my configuration. THIS WORKS!
During "make sonar", cppcheck generates correctly an XML report :
1 |?xml version="1.0" encoding="UTF-8"?|
2 |results|
3 |error file="src/lib/component1.cc" line="17" id="unusedVariable" severity="style" msg="Unused variable: x"/|
4 |error file="src/lib/component1.cc" line="37" id="unreadVariable" severity="style" msg="Variable 'i' is assigned a value that is never used."/|
5 |error file="src/lib/component1.cc" line="47" id="deallocDealloc" severity="error" msg="Deallocating a deallocated pointer: ip"/|
6 |error file="src/lib/component1.cc" line="47" id="doubleFree" severity="error" msg="Memory pointed to by 'ip' is freed twice."/|
7 |error file="src/lib/component1.cc" line="32" id="uninitvar" severity="error" msg="Uninitialized variable: a"/|
8 |error file="src/lib/component2.cc" line="16" id="unusedVariable" severity="style" msg="Unused variable: x"/|
9 |error file="src/lib/component2.cc" line="36" id="unreadVariable" severity="style" msg="Variable 'i' is assigned a value that is never used."/|
10 |error file="src/lib/component2.cc" line="46" id="deallocDealloc" severity="error" msg="Deallocating a deallocated pointer: ip"/|
11 |error file="src/lib/component2.cc" line="46" id="doubleFree" severity="error" msg="Memory pointed to by 'ip' is freed twice."/|
12 |error file="src/lib/component2.cc" line="31" id="uninitvar" severity="error" msg="Uninitialized variable: a"/|
13 |error file="src/lib/component1.cc" line="24" id="unusedFunction" severity="style" msg="The function 'do_valgrind_errors' is never used."/|
14 |/results|
BUT during sonar-runner analysis, the CxxCppCheckSensor encounters a problem:
INFO - Sensor CxxCppCheckSensor...
INFO - Processing report '/data/sonarqube/cxx/SampleProject2/build/cppcheck-report.xml'
INFO - cppcheck V2 - Parsing report '/data/sonarqube/cxx/SampleProject2/build/cppcheck-report.xml'
INFO - cppcheck V1 - Parsing :report '/data/sonarqube/cxx/SampleProject2/build/cppcheck-report.xml'
WARN - Cannot find the file 'src/lib/component1.cc', skipping violations
WARN - Cannot find the file 'src/lib/component2.cc', skipping violations
INFO - Added report '/data/sonarqube/cxx/SampleProject2/build/cppcheck-report.xml' (parsed by: org.sonar.plugins.cxx.cppcheck.CppcheckParserV1@4d4908d4)
INFO - Sensor CxxCppCheckSensor done: 16 ms
The files 'src/lib/component1.cc' and 'src/lib/component2.cc', which are
available and readable, are not found! So no cppcheck errors are reported in
the Sample project in the sonarqube dashboard.
What is wrong here?
The text was updated successfully, but these errors were encountered: