Skip to content

Commit

Permalink
add values when using more than 1 filter
Browse files Browse the repository at this point in the history
  • Loading branch information
cfabianski committed Dec 20, 2024
1 parent 59ea216 commit b25dbbe
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/scanner/detectors/customrule/filters/filters.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,17 @@ func (filter *All) joinMatches(matches, childMatches []Match) []Match {
for _, match := range matches {
for _, childMatch := range childMatches {
if variables, variablesMatch := match.variables.Merge(childMatch.variables); variablesMatch {
value := match.Value()

if value != nil {
*value += *childMatch.Value()
} else {
value = childMatch.Value()
}

result = append(result, NewMatch(
variables,
nil,
value,
// FIXME: this seems like it will create unnecessary duplicates
append(match.datatypeDetections, childMatch.datatypeDetections...),
))
Expand Down

0 comments on commit b25dbbe

Please sign in to comment.