-
Notifications
You must be signed in to change notification settings - Fork 137
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
Reduce number of CVE collisions dependency-check/dependency-check-son… #763
base: master
Are you sure you want to change the base?
Conversation
Can you please provide a screenshot of how the offset affects the SonarQube UI? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that I don't like the solution. If I'm looking over the changes correctly, then take the vulnerability e.g. CVE-2022-23305
, make it 202223305
and use this number as a direct text offset (202223305) or as a text offset + 1 (202223306). Do I understand the approach correctly?
putDependencyMap(dependency, new TextRangeConfidence(buildGradle.selectLine(linenumber), Confidence.HIGHEST)); | ||
putDependencyMap(dependency, vulnerability, new TextRangeConfidence(buildGradle.selectLine(linenumber), Confidence.HIGHEST)); | ||
return; | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The else
is unnecessary because we have a return
in the if
.
...dependency-check-plugin/src/main/java/org/sonar/dependencycheck/reason/DependencyReason.java
Outdated
Show resolved
Hide resolved
Yes, with the result of the issue being attached to the lines at offset 202223305, instead of the entire line, allowing for multiple vulnerabilities on the same line without colliding. It's certainly not a complete solution, since if the vulnerability has no numbers in the name it will default to offset 0, allowing for collisions. Or if one line has multiple vulnerabilities with the same CVE. Otherwise, nothing changes visually, just the location that the issues are tracked internally by SonarQube. |
I don't like the solution with the offsets because it has an unclean taste. Since the solution probably works, I leave the pull request open for people who also want to solve the problem. |
…ar-plugin#682
Uses the CVE number as a line offset to reduce overlap.