testaro 18.13.1 → 18.13.2
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/standardize.js +24 -22
package/package.json
CHANGED
package/standardize.js
CHANGED
|
@@ -320,29 +320,31 @@ const convert = (toolName, result, standardResult) => {
|
|
|
320
320
|
// ibm
|
|
321
321
|
else if (toolName === 'ibm' && result.totals) {
|
|
322
322
|
standardResult.totals = [0, result.totals.recommendation, 0, result.totals.violation];
|
|
323
|
-
result.items
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
323
|
+
if (result.items) {
|
|
324
|
+
result.items.forEach(item => {
|
|
325
|
+
const identifiers = getIdentifiers(item.snippet);
|
|
326
|
+
if (! identifiers[0] && item.path && item.path.dom) {
|
|
327
|
+
const tagNameArray = item.path.dom.match(/^.+\/([^/[]+)/s);
|
|
328
|
+
if (tagNameArray && tagNameArray.length === 2) {
|
|
329
|
+
identifiers[0] = tagNameArray[1].toUpperCase();
|
|
330
|
+
}
|
|
329
331
|
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
}
|
|
332
|
+
const instance = {
|
|
333
|
+
ruleID: item.ruleId,
|
|
334
|
+
what: item.message,
|
|
335
|
+
ordinalSeverity: ['', 'recommendation', '', 'violation'].indexOf(item.level),
|
|
336
|
+
tagName: identifiers[0],
|
|
337
|
+
id: identifiers[1],
|
|
338
|
+
location: {
|
|
339
|
+
doc: 'dom',
|
|
340
|
+
type: 'xpath',
|
|
341
|
+
spec: item.path.dom
|
|
342
|
+
},
|
|
343
|
+
excerpt: cap(item.snippet)
|
|
344
|
+
};
|
|
345
|
+
standardResult.instances.push(instance);
|
|
346
|
+
});
|
|
347
|
+
}
|
|
346
348
|
}
|
|
347
349
|
// nuVal
|
|
348
350
|
else if (toolName === 'nuVal' && (result.pageContent || result.rawPage)) {
|