-
Notifications
You must be signed in to change notification settings - Fork 153
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/clarify-vulnerabilities-found/ #608
Conversation
Caution Review failedThe pull request is closed. WalkthroughThe changes in this pull request involve significant updates to the Changes
Possibly related PRs
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
a1ce6cf
to
b6222d6
Compare
0024b04
to
8370e17
Compare
392c07d
to
85fe87d
Compare
c5f5d53
to
7d48881
Compare
f8ae84a
to
d8f5078
Compare
3c1887e
to
d9b62c0
Compare
576731f
to
bd1d198
Compare
e83a1bd
to
8eac6b2
Compare
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.
Looks good! Just one function to see if we can optimize on!
@@ -789,3 +790,33 @@ def system_scan(ctx: typer.Context, | |||
console.print(Padding(detail, (0, 0, 0, 1)), emoji=True, overflow="crop") | |||
|
|||
process_report(ctx.obj, console, report, **{**ctx.params}) | |||
|
|||
def get_vulnerability_summary(report: Dict[str, Any]) -> Tuple[int, int]: |
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.
If we can reduce the nesting it may help with efficiency.
Here is something to try to check if it produces the same:
def get_vulnerability_summary(report: Dict[str, Any]) -> Tuple[int, int]:
"""
Summarize vulnerabilities from the given report.
Args:
report (ReportModel): The report containing vulnerability data.
Returns:
Tuple[int, int]: A tuple containing:
- Total number of issues (including duplicates)
- Total number of ignored issues
"""
total_issues = 0
ignored_issues = 0
for project in report.scan_results.projects:
for file in project.files:
for dependency in file.results.dependencies:
for specification in dependency.specifications:
known_vulnerabilities = specification.vulnerabilities.known_vulnerabilities
total_issues += len(known_vulnerabilities)
ignored_issues += sum(1 for v in known_vulnerabilities if v.ignored)
return total_issues, ignored_issues
Fixed the issue where the vulnerabilities
8eac6b2
to
07bc5b7
Compare
Fixed the issue where the vulnerabilities
found were not being displayed correctly.
New Format:
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Bug Fixes
Tests