filtering

package
v0.0.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterViolations

func FilterViolations(violations []model.Violation, predicate func(model.Violation) bool) []model.Violation

func FilterViolationsByKeywords

func FilterViolationsByKeywords(violations []model.Violation, keywords []string) []model.Violation

func ShouldAnalyze

func ShouldAnalyze(detectionContext *model.DetectionContext, logger log.DDSourceLogger) bool

ShouldAnalyze does a very early, cheap filter to decide if a file is worth running a given rule on. Return true => run the rule. Return false => skip.

func StripCodeForDetection

func StripCodeForDetection(code string, language model.Language) string

StripCodeForDetection returns lowercased code with comments/docstrings stripped. Call this once per file and store in DetectionContext.StrippedCode to avoid redundant regex operations when checking multiple rules against the same file.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL