Skip to content

Commit 1bf0d35

Browse files
committed
fix(rules): Adjust to the new vulnerability API
See [1]. [1]: oss-review-toolkit/ort#9091 Signed-off-by: Sebastian Schuberth <[email protected]>
1 parent e74d2ed commit 1bf0d35

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

evaluator.rules.kts

+3-7
Original file line numberDiff line numberDiff line change
@@ -1540,18 +1540,14 @@ fun RuleSet.vulnerabilityInDependencyRule() = packageRule("VULNERABILITY_IN_DEPE
15401540
}
15411541

15421542
fun RuleSet.vulnerabilityWithHighSeverityInDependencyRule() = packageRule("HIGH_SEVERITY_VULNERABILITY_IN_DEPENDENCY") {
1543-
val maxAcceptedSeverity = "5.0"
1543+
val scoreThreshold = 5.0f
15441544

15451545
require {
15461546
-isProject()
15471547
-isExcluded()
15481548
+AnyOf(
1549-
hasVulnerability(maxAcceptedSeverity, "CVSS2") { value, threshold ->
1550-
value.toFloat() >= threshold.toFloat()
1551-
},
1552-
hasVulnerability(maxAcceptedSeverity, "CVSS3") { value, threshold ->
1553-
value.toFloat() >= threshold.toFloat()
1554-
}
1549+
hasVulnerability(scoreThreshold, "CVSS2"),
1550+
hasVulnerability(scoreThreshold, "CVSS3")
15551551
)
15561552
}
15571553

0 commit comments

Comments
 (0)