Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
opeco17 committed Mar 4, 2024
1 parent 7583d41 commit b20d61d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions poetry_audit_plugin/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,20 @@ def handle(self) -> None:
self.chatty_line_error(str(e))
sys.exit(e.get_exit_code())
try:
vulnerable_packages, amount_of_ignored_vulnerabilities = self.filter_vulnerable_packages(
check_vulnerable_packages(
session, packages, int(self.option("cache-sec")) if self.option("cache-sec") else 0
),
ignored_packages,
ignored_codes,
all_vulnerable_packages = check_vulnerable_packages(
session, packages, int(self.option("cache-sec")) if self.option("cache-sec") else 0
)
except SafetyDBAccessError as e:
self.chatty_line_error(f"<error>Error occured while accessing Safety DB.</error>")
self.chatty_line_error("")
self.chatty_line_error(str(e))
sys.exit(e.get_exit_code())

vulnerable_packages, amount_of_ignored_vulnerabilities = self.filter_vulnerable_packages(
all_vulnerable_packages,
ignored_packages,
ignored_codes,
)
max_line_lengths = self.calculate_line_length(vulnerable_packages)
amount_of_vulnerable_packages = len(vulnerable_packages)
if self.option("json"):
Expand Down

0 comments on commit b20d61d

Please sign in to comment.