testilo 19.2.10 → 19.3.0
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.
- package/package.json +1 -1
- package/procs/score/tsp37.js +14 -1
package/package.json
CHANGED
package/procs/score/tsp37.js
CHANGED
|
@@ -67,6 +67,14 @@ exports.scorer = report => {
|
|
|
67
67
|
// Initialize the score data.
|
|
68
68
|
const score = {
|
|
69
69
|
scoreProcID,
|
|
70
|
+
weights: {
|
|
71
|
+
severities: severityWeights,
|
|
72
|
+
tool: toolWeight,
|
|
73
|
+
log: logWeights,
|
|
74
|
+
latency: latencyWeight,
|
|
75
|
+
prevention: preventionWeight
|
|
76
|
+
},
|
|
77
|
+
normalLatency,
|
|
70
78
|
summary: {
|
|
71
79
|
total: 0,
|
|
72
80
|
issue: 0,
|
|
@@ -83,7 +91,8 @@ exports.scorer = report => {
|
|
|
83
91
|
},
|
|
84
92
|
prevention: {},
|
|
85
93
|
issue: {},
|
|
86
|
-
solo: {}
|
|
94
|
+
solo: {},
|
|
95
|
+
tool: {}
|
|
87
96
|
}
|
|
88
97
|
};
|
|
89
98
|
const {summary, details} = score;
|
|
@@ -105,6 +114,10 @@ exports.scorer = report => {
|
|
|
105
114
|
// Add the severity totals of the tool to the score.
|
|
106
115
|
const {totals} = standardResult;
|
|
107
116
|
details.severity.byTool[which] = totals;
|
|
117
|
+
// Add the severity-weighted tool totals to the score.
|
|
118
|
+
details.tool[which] = totals.reduce(
|
|
119
|
+
(sum, current, index) => sum + severityWeights[index] * current, 0
|
|
120
|
+
);
|
|
108
121
|
// For each instance of the tool:
|
|
109
122
|
standardResult.instances.forEach(instance => {
|
|
110
123
|
// Get the rule ID.
|