SQLAnalyzer provides deep AST-based analysis of SQL queries
| 25 | |
| 26 | // SQLAnalyzer provides deep AST-based analysis of SQL queries |
| 27 | type SQLAnalyzer struct { |
| 28 | // Unified analysis results |
| 29 | Issues []AnalysisIssue |
| 30 | ComplexityMetrics ComplexityMetrics |
| 31 | |
| 32 | // Score tracking |
| 33 | SecurityScore int |
| 34 | PerformanceScore int |
| 35 | |
| 36 | // AST traversal state |
| 37 | currentDepth int |
| 38 | maxDepth int |
| 39 | joinCount int |
| 40 | subqueryCount int |
| 41 | functionCount int |
| 42 | hasCartesian bool |
| 43 | hasSelectStar bool |
| 44 | hasLiteralInWhere bool |
| 45 | } |
| 46 | |
| 47 | // NewSQLAnalyzer creates a new AST-based SQL analyzer |
| 48 | func NewSQLAnalyzer() *SQLAnalyzer { |
nothing calls this directly
no outgoing calls
no test coverage detected