-
Notifications
You must be signed in to change notification settings - Fork 2
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
fix: sort descending by CVSS scores first #27
Conversation
8d79827
to
1c56612
Compare
bd845fc
to
7f19863
Compare
It requires the use of another tool, and is more opinionated than worthwhile.
Applies feedback on the CVSS2 version to this one.
The inline expectations are getting large, and the upcoming change includes a structure with private internals.
1c56612
to
84ccc66
Compare
Allows for consistent representation and easier sorting.
84ccc66
to
57d2e5b
Compare
|
||
Ignore *findingconfig.Ignore | ||
} | ||
|
||
type CVSSScore struct { | ||
Score *decimal.Decimal |
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.
Interesting. Why use a pointer to a Decimal?
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.
Because html/template
understands nil
more easily than Decimal{}
making the rendering logic easier. Also it helps make it clear when the score is not supplied versus valued. I originally wrote this without the pointer, switching only when it came to rendering.
Co-authored-by: Callum Gardner <callum.gardner@cultureamp.com>
Co-authored-by: Callum Gardner <callum.gardner@cultureamp.com>
Co-authored-by: Callum Gardner <callum.gardner@cultureamp.com>
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.
Responses
For some reason my comments via vscode were added to a review rather than just answering the thread. TIL |
Yep, it's a limitation of the VS Code extension. It's still my preferred method of reviewing PRs though, including this one. 😉 |
Tip
This PR reads commit-by-commit
Based on CVSS3 support added in #26.
Leads to more readily understandable annotations as the most critical are rendered higher.
CVSS3 and CVSS2 schemes are sorted separately because their scoring outcomes are not comparable. This means that in longer lists, CVSS2 results are pushed down the page, however considering that AWS is moving away from CVSS2 and few images have such a massive pile of issues it's probably the right trade-off.
Sort is by:
Example: