Documentation
¶
Index ¶
- func FilterViolations(violations []model.Violation, predicate func(model.Violation) bool) []model.Violation
- func FilterViolationsByKeywords(violations []model.Violation, keywords []string) []model.Violation
- func ShouldAnalyze(detectionContext *model.DetectionContext, logger log.DDSourceLogger) bool
- func StripCodeForDetection(code string, language model.Language) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterViolations ¶
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 ¶
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.
Click to show internal directories.
Click to hide internal directories.