We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8da445f commit eff2f9bCopy full SHA for eff2f9b
vulnerabilities/pipelines/v2_importers/alpine_linux_importer.py
@@ -46,15 +46,14 @@ def steps(cls):
46
)
47
48
def advisories_count(self) -> int:
49
- base_path = Path(self.vcs_response.dest_dir) / "secdb"
50
- count = 0
51
-
52
- for json_file in base_path.rglob("*.json"):
53
- data = json.loads(json_file.read_text(encoding="utf-8"))
54
- for pkg in data.get("packages", []):
55
- count += len(pkg.get("advisories", []))
56
57
- return count
+ return sum(
+ len(pkg.get("advisories", []))
+ for data in (
+ json.loads(p.read_text())
+ for p in (Path(self.vcs_response.dest_dir) / "secdb").rglob("*.json")
+ )
+ for pkg in data.get("packages", [])
58
59
def clone(self):
60
self.log(f"Cloning `{self.repo_url}`")
0 commit comments