-
Notifications
You must be signed in to change notification settings - Fork 39
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
CPPCheckParser does not parse auto closed <error/> tags #82
Comments
Sample cppcheck output: <?xml version="1.0" encoding="UTF-8"?>
<results>
<error file="filename.cpp" line="49" id="variableScope" severity="style" msg="The scope of the variable 'softwareComponentsAreOk' can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced:
void f(int x)
{
int i = 0;
if (x) {
// it's safe to move 'int i = 0;' here
for (int n = 0; n < 10; ++n) {
// it is possible but not safe to move 'int i = 0;' here
do_something(&i);
}
}
}
When you see this message it is always safe to reduce the variable scope 1 level."/>
</results> |
All the tools should have this fix now! Open issue again if not working. |
This fix caused a regression in the warnings plugin, it breaks one of my test cases: jenkinsci/analysis-model#291 Seems that now some violations are reported twice: for the following file I get three violations per error now. With the previous release I got only two violations (and that seems to be correct).
|
I added a test case, and I do get 4 violations: |
@uhafner I add the result to a I think that is why you get 6 results, and I get 4. |
Ok, this was not required in 1.109. Nevertheless, since I am already storing all the issues in a set I can change that in my implementation quite easily (see jenkinsci/analysis-model@8258926). Thanks for the tip! |
CPPCheckParser.java
final List<String> errorChunks = getChunks(string, "<error", "</error>");
This code does not parse tags.
When I run
cppcheck
with--xml
parameter, the output I get is<error/>
and not<error></error>
The text was updated successfully, but these errors were encountered: