testilo 33.3.0 → 33.4.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testilo",
3
- "version": "33.3.0",
3
+ "version": "33.4.0",
4
4
  "description": "Prepares Testaro jobs and processes Testaro reports",
5
5
  "main": "call.js",
6
6
  "scripts": {
@@ -68,6 +68,7 @@ exports.scorer = report => {
68
68
  if (Array.isArray(acts) && acts.length) {
69
69
  // If any of them are test acts:
70
70
  const testActs = acts.filter(act => act.type === 'test');
71
+ const testTools = new Set(testActs.map(act => act.which));
71
72
  if (testActs.length) {
72
73
  // Initialize the score data.
73
74
  const score = {
@@ -245,6 +246,14 @@ exports.scorer = report => {
245
246
  // Get the score for the issue, including any addition for the instance count limit.
246
247
  const maxAddition = issueData.countLimit ? maxWeight / issueData.countLimit : 0;
247
248
  issueData.score = Math.round(issueData.weight * issueData.maxCount * (1 + maxAddition));
249
+ // For each tool that has any rule of the issue:
250
+ Object.keys(issues[issueName].tools).forEach(toolName => {
251
+ // If the tool was in the job and has no instances of the issue:
252
+ if (testTools.has(toolName) && ! issueData.instanceCounts[toolName]) {
253
+ // Report its instance count as 0.
254
+ issueData.instanceCounts[toolName] = 0;
255
+ }
256
+ });
248
257
  });
249
258
  // Add the severity detail totals to the score.
250
259
  details.severity.total = Object.keys(details.severity.byTool).reduce((severityTotals, toolID) => {