MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / shouldInclude

Method shouldInclude

pkg/sql/security/scanner.go:1115–1130  ·  view source on GitHub ↗

shouldInclude checks if a finding meets the minimum severity threshold. Unknown severities are treated as highest priority (always included) for security.

(severity Severity)

Source from the content-addressed store, hash-verified

1113// shouldInclude checks if a finding meets the minimum severity threshold.
1114// Unknown severities are treated as highest priority (always included) for security.
1115func (s *Scanner) shouldInclude(severity Severity) bool {
1116 findingSeverity, findingExists := severityOrder[severity]
1117 minSeverity, minExists := severityOrder[s.MinSeverity]
1118
1119 // Unknown severities are always included (fail-safe: don't hide potential issues)
1120 if !findingExists {
1121 return true
1122 }
1123
1124 // If minimum severity is unknown, default to showing all
1125 if !minExists {
1126 return true
1127 }
1128
1129 return findingSeverity >= minSeverity
1130}
1131
1132// updateCounts updates the count fields in the result.
1133func (s *Scanner) updateCounts(result *ScanResult) {

Callers 8

scanBinaryExpressionMethod · 0.95
checkOrInjectionMethod · 0.95
checkUnionInjectionMethod · 0.95
scanFunctionCallMethod · 0.95
detectCommentPatternsMethod · 0.95
detectTautologyInSQLMethod · 0.95
detectRegexPatternsMethod · 0.95

Calls

no outgoing calls

Tested by 1