Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions plugin/analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package plugin

import (
"context"
"slices"
"strings"
"time"

Expand Down Expand Up @@ -426,10 +427,8 @@ func lookupFinding(r RunnerResult, vuln *model.Vulnerability) (Finding, bool) {
if alias == vuln.ID {
return f, true
}
for _, vulnAlias := range vuln.Aliases {
if alias == vulnAlias {
return f, true
}
if slices.Contains(vuln.Aliases, alias) {
return f, true
}
}
}
Expand Down
10 changes: 4 additions & 6 deletions plugin/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bufio"
"encoding/json"
"fmt"
"slices"
"strings"

model "github.com/bomly-dev/bomly-sdk"
Expand Down Expand Up @@ -136,8 +137,7 @@ func mergeFinding(into map[string]Finding, modules map[string]struct{}, buildMod
// The SDK's CallPath contract is entry point → sink (Frames[0] is the
// entry point), the reverse of govulncheck's trace order.
frames := make([]model.CallFrame, 0, len(src.Trace))
for i := len(src.Trace) - 1; i >= 0; i-- {
t := src.Trace[i]
for _, t := range slices.Backward(src.Trace) {
if t.Module != "" && t.Package != "" {
modules[t.Module] = struct{}{}
}
Expand Down Expand Up @@ -224,10 +224,8 @@ func symbolKind(t traceEntry) model.SymbolKind {
}

func appendUnique(values []string, candidate string) []string {
for _, v := range values {
if v == candidate {
return values
}
if slices.Contains(values, candidate) {
return values
}
return append(values, candidate)
}
Expand Down
Loading