From 79d0b4743c54ce892e292ee9e009dce559dc3f36 Mon Sep 17 00:00:00 2001 From: Martin Forstner Date: Thu, 25 Feb 2021 22:09:29 +0100 Subject: [PATCH] fix: some fixes --- lib/utils/result-functions.ts | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/lib/utils/result-functions.ts b/lib/utils/result-functions.ts index efa5b94..7995487 100644 --- a/lib/utils/result-functions.ts +++ b/lib/utils/result-functions.ts @@ -14,20 +14,8 @@ export function setResult( if (violations.filter((v) => v.id === violation.id).length > 0) { const reportViolation = violations.filter((v) => v.id === violation.id)[0]; for (const node of violation.nodes) { - if ( - reportViolation.nodes.filter( - (v) => - v.targetResult.target.length === node.target.length && - v.targetResult.target.every((value, index) => value === node.target[index]), - ).length > 0 - ) { - reportViolation.nodes - .filter( - (v) => - v.targetResult.target.length === node.target.length && - v.targetResult.target.every((value, index) => value === node.target[index]), - )[0] - .targetResult.urls.push(result.url); + if (reportViolation.nodes.filter((v) => v.html === node.html).length > 0) { + reportViolation.nodes.filter((v) => v.html === node.html)[0].targetResult.urls.push(result.url); } else { reportViolation.nodes.push({ none: node.none,