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

Method addPerformanceIssue

cmd/gosqlx/cmd/sql_analyzer.go:337–360  ·  view source on GitHub ↗
(issueType, severity, description, impact, suggestion string)

Source from the content-addressed store, hash-verified

335}
336
337func (a *SQLAnalyzer) addPerformanceIssue(issueType, severity, description, impact, suggestion string) {
338 var sev IssueSeverity
339 switch strings.ToLower(severity) {
340 case "critical":
341 sev = IssueSeverityCritical
342 case "high":
343 sev = IssueSeverityHigh
344 case "medium":
345 sev = IssueSeverityMedium
346 case "low":
347 sev = IssueSeverityLow
348 default:
349 sev = IssueSeverityMedium
350 }
351
352 issue := NewIssue(issueType, IssueCategoryPerformance, sev).
353 WithDescription(description).
354 WithImpact(impact).
355 WithSuggestion(suggestion).
356 Build()
357
358 a.Issues = append(a.Issues, issue)
359 a.adjustPerformanceScore(sev)
360}
361
362func (a *SQLAnalyzer) adjustSecurityScore(severity IssueSeverity) {
363 switch severity {

Callers 7

analyzeJoinClauseMethod · 0.95
analyzeFunctionCallMethod · 0.95
analyzeIdentifierMethod · 0.95
analyzeLiteralValueMethod · 0.95

Calls 6

NewIssueFunction · 0.85
WithSuggestionMethod · 0.80
WithImpactMethod · 0.80
WithDescriptionMethod · 0.80
BuildMethod · 0.45

Tested by

no test coverage detected