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
locationChunks in CppCheck are reported as individual violations #54
Comments
See discussion in https://issues.jenkins-ci.org/browse/JENKINS-55733. |
The discussion in the Jenkins issue seems to indicate, that each toplevel warning in the issue is the thing that should be counted. |
Do you think this is feasible? This will require changes in the API. |
This library finds the final List<Violation> violationsList =
violationsApi() //
.withPattern(".*/cppcheck/example1\\.xml$") //
.inFolder(rootFolder) //
.findAll(CPPCHECK) //
.violations();
final Map<String, List<Violation>> violationsPerRule =
violationsList
.stream() //
.collect(Collectors.groupingBy(Violation::getRule));
assertThat(violationsPerRule) //
.hasSize(2);
assertThat(violationsPerRule.get("redundantAssignment")) //
.hasSize(2); |
I think that will work. Thanks for the help! |
After thinking (or coding) it a little bit further I think that it does not work this way. The problem is that we can have multiple error tags using the same |
Perhaps a
So that in this example |
Ok, that should work now 👍 |
Verified in jenkinsci/analysis-model@5e28d1b. |
I'm using your CppCheck parser in Jenkins Warnings plugin to read cppcheck files. In your parser you are converting each "location" of the original error structure to a violation. Actually each error should be converted to one violation only. Your violations should also provide a concept of multiple locations per violation (see SonarQube or Warning Plugin for an example).
See original Jenkins bug report.
The text was updated successfully, but these errors were encountered: