Skip to content

Commit

Permalink
feature/cve-flag
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanpulver committed Nov 14, 2024
1 parent ce993c0 commit bda0f49
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions safety/scan/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,20 +487,20 @@ def sort_vulns_by_score(vuln: Vulnerability) -> int:
}
)

if cve_data:
# Sort by severity
severity_order = {
"CRITICAL": 4,
"HIGH": 3,
"MEDIUM": 2,
"LOW": 1,
"UNKNOWN": 0, # Catch-all for unrecognized severities
}
cve_data.sort(key=lambda x: severity_order.get(x["severity"].upper(), 0), reverse=True)
console.print("\nCVE Details:\n", emoji=True)
console.print_json(data={"cve_details": cve_data})
else:
console.print("\nNo CVE details found.", emoji=True)
if cve_data:
# Sort by severity
severity_order = {
"CRITICAL": 4,
"HIGH": 3,
"MEDIUM": 2,
"LOW": 1,
"UNKNOWN": 0, # Catch-all for unrecognized severities
}
cve_data.sort(key=lambda x: severity_order.get(x["severity"].upper(), 0), reverse=True)
console.print("\nCVE Details:\n", emoji=True)
console.print_json(data={"cve_details": cve_data})
else:
console.print("\nNo CVE details found.", emoji=True)

report_url = process_report(ctx.obj, console, report, **{**ctx.params})
project_url = f"{SAFETY_PLATFORM_URL}{ctx.obj.project.url_path}"
Expand Down

0 comments on commit bda0f49

Please sign in to comment.