From 39f7e7b9e08ecf7e93bd6a09806a432a1c183e4e Mon Sep 17 00:00:00 2001 From: Juan Antonio Osorio Robles Date: Wed, 3 Jul 2019 14:51:43 +0300 Subject: [PATCH] Display filtered number of issues instead of total in stats This takes into account the filtered number of issues instead of the total number. This number is more relevant to developers, as the intention was to not take certain issues into account anyway. --- cmd/gosec/main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/gosec/main.go b/cmd/gosec/main.go index 7b2a886..2459e50 100644 --- a/cmd/gosec/main.go +++ b/cmd/gosec/main.go @@ -320,6 +320,9 @@ func main() { // Filter the issues by severity and confidence issues = filterIssues(issues, failSeverity, failConfidence) + if metrics.NumFound != len(issues) { + metrics.NumFound = len(issues) + } // Exit quietly if nothing was found if len(issues) == 0 && *flagQuiet {