secure-scan 1.2.2 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -52,9 +52,13 @@ export class RiskScoringEngine {
|
|
|
52
52
|
let totalScore = 0;
|
|
53
53
|
|
|
54
54
|
for (const finding of findings) {
|
|
55
|
-
const severityWeight = SEVERITY_WEIGHTS[finding.severity];
|
|
56
|
-
const categoryWeight = CATEGORY_WEIGHTS[finding.category];
|
|
57
|
-
|
|
55
|
+
const severityWeight = SEVERITY_WEIGHTS[finding.severity] || 1;
|
|
56
|
+
const categoryWeight = CATEGORY_WEIGHTS[finding.category] || 1;
|
|
57
|
+
// Handle undefined or invalid confidence values
|
|
58
|
+
const confidence = typeof finding.confidence === 'number' && !isNaN(finding.confidence)
|
|
59
|
+
? finding.confidence
|
|
60
|
+
: 80; // Default confidence
|
|
61
|
+
const confidenceMultiplier = confidence / 100;
|
|
58
62
|
|
|
59
63
|
totalScore += severityWeight * categoryWeight * confidenceMultiplier;
|
|
60
64
|
}
|