Skip to content

Commit

Permalink
ignore correlated findings whose detector is deleted (#811) (#816)
Browse files Browse the repository at this point in the history
Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
  • Loading branch information
amsiglan committed Nov 30, 2023
1 parent 5a46e04 commit 675e155
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions public/store/CorrelationsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,12 +268,16 @@ export class CorrelationsStore implements ICorrelationsStore {
);

if (response?.ok) {
const correlatedFindings = response.response.findings.map((f) => {
return {
...allFindings[f.finding],
correlationScore: f.score < 0.01 ? '0.01' : f.score.toFixed(2),
};
const correlatedFindings: CorrelationFinding[] = [];
response.response.findings.forEach((f) => {
if (allFindings[f.finding]) {
correlatedFindings.push({
...allFindings[f.finding],
correlationScore: f.score < 0.01 ? '0.01' : f.score.toFixed(2),
});
}
});

return {
finding: allFindings[finding],
correlatedFindings,
Expand Down

0 comments on commit 675e155

Please sign in to comment.