File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed
Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,6 @@ def compute_and_store_vulnerability_risk_score(self):
9090 for rel in advisory .related_advisory_severities .all ():
9191 severities .extend (rel .severities .all ())
9292
93-
9493 try :
9594 weighted_severity , exploitability = compute_vulnerability_risk_factors (
9695 references = references ,
@@ -101,7 +100,9 @@ def compute_and_store_vulnerability_risk_score(self):
101100 advisory .weighted_severity = weighted_severity
102101 advisory .exploitability = exploitability
103102 if advisory .exploitability and advisory .weighted_severity :
104- risk_score = min (float (advisory .exploitability * advisory .weighted_severity ), 10.0 )
103+ risk_score = min (
104+ float (advisory .exploitability * advisory .weighted_severity ), 10.0
105+ )
105106 advisory .risk_score = round (risk_score , 1 )
106107 updatables .append (advisory )
107108 except Exception as e :
Original file line number Diff line number Diff line change 88#
99from urllib .parse import urlparse
1010
11- from vulnerabilities .models import AdvisoryV2 , VulnerabilityReference
12- from vulnerabilities .severity_systems import EPSS
13- from vulnerabilities .weight_config import WEIGHT_CONFIG
1411from django .db .models import Max
1512
13+ from vulnerabilities .models import AdvisoryV2
14+ from vulnerabilities .models import VulnerabilityReference
15+ from vulnerabilities .severity_systems import EPSS
16+ from vulnerabilities .weight_config import WEIGHT_CONFIG
1617
1718DEFAULT_WEIGHT = 5
1819
@@ -127,9 +128,9 @@ def compute_package_risk_v2(package):
127128 """
128129
129130 max_risk = (
130- AdvisoryV2 .objects
131- . latest_affecting_advisories_for_purl ( package . purl )
132- . aggregate ( max_risk = Max ( "risk_score" ) )
131+ AdvisoryV2 .objects . latest_affecting_advisories_for_purl ( package . purl ). aggregate (
132+ max_risk = Max ( "risk_score" )
133+ )
133134 )["max_risk" ]
134135
135136 if max_risk is None :
You can’t perform that action at this time.
0 commit comments