Skip to content

Commit

Permalink
fix: set rule index result by security rules mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaharAvigezer committed Apr 18, 2022
1 parent 0e4d08e commit 37d4704
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/lib/plugins/sast/analysis.ts
Expand Up @@ -174,10 +174,9 @@ function getSecurityResultsOnly(
securityRules: string[],
): Result[] {
const securityResults = results.reduce((acc: Result[], result: Result) => {
const isSecurityResult = securityRules.some(
(securityRule) => securityRule === result?.ruleId,
);
if (isSecurityResult) {
const securityRule = securityRules.find((sr) => sr === result?.ruleId);
if (securityRule) {
result.ruleIndex = securityRules.indexOf(securityRule);
acc.push(result);
}
return acc;
Expand Down

0 comments on commit 37d4704

Please sign in to comment.