testilo 19.2.9 → 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/tic37.js +4 -1
- package/procs/score/tsp37.js +14 -1
package/package.json
CHANGED
package/procs/score/tic37.js
CHANGED
|
@@ -11,7 +11,10 @@
|
|
|
11
11
|
weight: weight of the issue in score computation
|
|
12
12
|
tools: tools (including Testaro) providing tests for the issue
|
|
13
13
|
|
|
14
|
-
Each property of tools is data about one of the tools that test for the issue. The key is the name
|
|
14
|
+
Each property of tools is data about one of the tools that test for the issue. The key is the name
|
|
15
|
+
of the tool. The value is an object containing data about the rules of the tool that pertain to
|
|
16
|
+
the issue. Each property of that object is data about one of those rules. The key is the
|
|
17
|
+
identifier of the rule, and the value is an object with these properties:
|
|
15
18
|
variable: whether the key is a regular expression
|
|
16
19
|
quality: the estimated quality of the test for the rule (normally 1)
|
|
17
20
|
what: description of a rule violation
|
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.
|