testilo 41.5.3 → 41.5.5

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": "41.5.3",
3
+ "version": "41.5.5",
4
4
  "description": "Prepares Testaro jobs and processes Testaro reports",
5
5
  "main": "call.js",
6
6
  "scripts": {
@@ -165,7 +165,7 @@
165
165
  </ul>
166
166
  <h3>Scoring method details</h3>
167
167
  <p>The above component descriptions omit various details.</p>
168
- <p>About a thousand tool rules are classified into <dfn>issues</dfn> in the <code>tic45.js</code> file used by this procedure. Each of those rules has a <dfn>quality</dfn>, ranging from 0 to 1. When the <strong>issue score</strong> is computed, the count of violations of each rule is multiplied by the quality of that rule. Whichever tool has the largest quality-weighted violation count for an issue, that count is treated as the instance count for the issue. Thus, if 8 tools each report 15 violations within the issue, and their rule qualities are all 1, the instance count is 15, not 120. Moreover, the issue itself has a <dfn>weight</dfn>, ranging from 1 to 4, representing its importance. This instance count is multiplied by that weight. That product is further multiplied by the <code>issueCountWeight</code> value, namely 10. That final product is further adjusted if the issue is inherently limited in instance count. For example, if the issue is that the page <code>html</code> element has no <code>lang</code> attribute, the instance count is limited to 1. If there is such a limit, the <code>maxWeight</code> value, namely 30, is divided by the actual instance count and the quotient is added to 1. That product (or 1 if there is no limit) is multiplied by the instance count, and then the result is treated as the contribution of the issue to the issue score.</p>
168
+ <p>About a thousand tool rules are classified into <dfn>issues</dfn> in the <code>tic49.js</code> file used by this procedure. Each of those rules has a <dfn>quality</dfn>, ranging from 0 to 1. When the <strong>issue score</strong> is computed, the count of violations of each rule is multiplied by the quality of that rule. Whichever tool has the largest quality-weighted violation count for an issue, that count is treated as the instance count for the issue. Thus, if 8 tools each report 15 violations within the issue, and their rule qualities are all 1, the instance count is 15, not 120. Moreover, the issue itself has a <dfn>weight</dfn>, ranging from 1 to 4, representing its importance. This instance count is multiplied by that weight. That product is further multiplied by the <code>issueCountWeight</code> value, namely 10. That final product is further adjusted if the issue is inherently limited in instance count. For example, if the issue is that the page <code>html</code> element has no <code>lang</code> attribute, the instance count is limited to 1. If there is such a limit, the <code>maxWeight</code> value, namely 30, is divided by the actual instance count and the quotient is added to 1. That product (or 1 if there is no limit) is multiplied by the instance count, and then the result is treated as the contribution of the issue to the issue score.</p>
169
169
  <p>Each <dfn>solo</dfn> (not yet issue-classified) rule violation is multiplied by the sum of 1 and the ordinal severity of the rule, to produce the <strong>solo score</strong>.</p>
170
170
  <p>Each rule violation reported by each tool is severity-weighted in the same way as solo rule violations are. Then the sum of those violations is multiplied by the <code>toolWeight</code> value, namely 0.1, to produce the <strong>tool score</strong>.</p>
171
171
  <p>The count of elements reported as violators of any rule is multiplied by the <code>elementWeight</code> value, namely 2, to produce the <strong>element score</strong>.</p>
@@ -284,12 +284,10 @@ exports.issues = {
284
284
  quality: 0.5,
285
285
  what: 'Script removes the focus when focus is received [invalid]'
286
286
  },
287
- qualWeb: {
288
- 'QW-WCAG-T32': {
289
- variable: false,
290
- quality: 1,
291
- what: 'ol, ul or dl may fail to be used for a list or group of links [speculative]'
292
- }
287
+ 'QW-WCAG-T32': {
288
+ variable: false,
289
+ quality: 1,
290
+ what: 'ol, ul or dl may fail to be used for a list or group of links [speculative]'
293
291
  }
294
292
  }
295
293
  }
@@ -50,8 +50,6 @@ const issueCountWeight = 10;
50
50
  */
51
51
  const maxWeight = 30;
52
52
 
53
- // 2. Solo
54
-
55
53
  // 3. Tool
56
54
  /*
57
55
  Severity: amount added to each raw tool score by each violation of a rule with ordinal severity 0
@@ -90,7 +88,7 @@ const latencyWeight = 2;
90
88
 
91
89
  // RULE CONSTANTS
92
90
 
93
- // Initialize a table of tool rules.
91
+ // Initialize a table of issue-classified tool rules.
94
92
  const issueIndex = {};
95
93
  // Initialize an array of variably named tool rules.
96
94
  const issueMatcher = [];
@@ -100,10 +98,8 @@ Object.keys(issues).forEach(issueName => {
100
98
  Object.keys(issues[issueName].tools).forEach(toolName => {
101
99
  // For each of those rules:
102
100
  Object.keys(issues[issueName].tools[toolName]).forEach(ruleID => {
101
+ issueIndex[toolName] ??= {};
103
102
  // Add it to the table of tool rules.
104
- if (! issueIndex[toolName]) {
105
- issueIndex[toolName] = {};
106
- }
107
103
  issueIndex[toolName][ruleID] = issueName;
108
104
  // If it is variably named:
109
105
  if (issues[issueName].tools[toolName][ruleID].variable) {
@@ -197,8 +193,8 @@ exports.scorer = report => {
197
193
  standardResult.instances.forEach(instance => {
198
194
  const {ordinalSeverity, pathID, ruleID, what} = instance;
199
195
  const count = instance.count || 1;
200
- // If the rule ID is not in the table of tool rules:
201
196
  let canonicalRuleID = ruleID;
197
+ // If the rule ID is not in the table of issue-classified tool rules:
202
198
  if (! issueIndex[which][ruleID]) {
203
199
  // Convert it to the variably named tool rule that it matches, if any.
204
200
  canonicalRuleID = issueMatcher.find(pattern => {