feat: tweak rules (#1608)

This commit is contained in:
Richard Gomez authored and GitHub committed 2024-10-29 01:47:12 -05:00
1 parent 43fae355e6
commit 5c2e8132f2
8 files changed
+188 -139

No files matched your search

+2 -2
View File
@@ -15,9 +15,9 @@ const (
caseInsensitive = `(?i)`
// identifier prefix (just an ignore group)
identifierCaseInsensitivePrefix = `[\w.-]{0,10}?(?i:`
identifierCaseInsensitivePrefix = `[\w.-]{0,50}?(?i:`
identifierCaseInsensitiveSuffix = `)`
identifierPrefix = `[\w.-]{0,10}?(?:`
identifierPrefix = `[\w.-]{0,50}?(?:`
identifierSuffix = `)(?:[ \t\w.-]{0,20})(?:[\s|']|[\s|"]){0,3}`
// commonly used assignment operators or function call
+2 -1
View File
@@ -25,7 +25,8 @@ func Validate(rule config.Rule, truePositives []string, falsePositives []string)
}
}
for _, fp := range falsePositives {
if len(d.DetectString(fp)) != 0 {
findings := d.DetectString(fp)
if len(findings) != 0 {
log.Fatal().
Str("rule", r.RuleID).
Str("value", fp).