Skip to content

Commit

Permalink
feat: log why false positives are skipped
Browse files Browse the repository at this point in the history
  • Loading branch information
rgmz committed Nov 8, 2024
1 parent 781157a commit ffa2fcb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/detectors/falsepositives.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,12 @@ func FilterKnownFalsePositives(ctx context.Context, detector Detector, results [
continue
}

if isFp, _ := isFalsePositive(result); !isFp {
filteredResults = append(filteredResults, result)
isFp, reason := isFalsePositive(result)
if isFp {
ctx.Logger().V(4).Info("Filtered out false positive", "result", result.Raw, "reason", reason)
continue
}
filteredResults = append(filteredResults, result)
}

return filteredResults
Expand Down

0 comments on commit ffa2fcb

Please sign in to comment.