Documentation
¶
Index ¶
- type AnalysisIssue
- type AnalysisSummary
- type ComplexityMetrics
- type DepType
- type DependencyInfo
- type EdgeType
- type FileInfo
- type FunctionNode
- type GraphEdge
- type GraphNode
- type ImportInfo
- type ImportKind
- type IssueCategory
- type IssueSeverity
- type Location
- type NodeType
- type RefKind
- type ReferenceInfo
- type SymbolInfo
- type SymbolKind
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnalysisIssue ¶
type AnalysisIssue struct {
Location Location `json:"location"`
Message string `json:"message"`
Category IssueCategory `json:"category"`
Severity IssueSeverity `json:"severity"`
Suggestion string `json:"suggestion,omitempty"`
Code string `json:"code,omitempty"`
}
AnalysisIssue represents a static analysis issue
type AnalysisSummary ¶
type AnalysisSummary struct {
TotalIssues int `json:"total_issues"`
BySeverity map[IssueSeverity]int `json:"by_severity"`
ByCategory map[IssueCategory]int `json:"by_category"`
FilesScanned int `json:"files_scanned"`
}
AnalysisSummary represents a summary of analysis results
type ComplexityMetrics ¶
type ComplexityMetrics struct {
Cyclomatic int `json:"cyclomatic"`
Cognitive int `json:"cognitive"`
Lines int `json:"lines"`
Functions int `json:"functions"`
AvgPerFunc float64 `json:"avg_per_func"`
}
ComplexityMetrics represents code complexity metrics
type DependencyInfo ¶
type DependencyInfo struct {
From string `json:"from"`
To string `json:"to"`
Type DepType `json:"type"`
Kind ImportKind `json:"kind,omitempty"`
}
DependencyInfo represents a dependency relationship
type FileInfo ¶
type FileInfo struct {
Path string `json:"path"`
Package string `json:"package"`
Imports []ImportInfo `json:"imports"`
Functions int `json:"functions"`
Types int `json:"types"`
Lines int `json:"lines"`
Complexity int `json:"complexity"`
}
FileInfo represents information about a source file
type FunctionNode ¶
FunctionNode represents an AST node for a function
type GraphEdge ¶
type GraphEdge struct {
From string `json:"from"`
To string `json:"to"`
Type EdgeType `json:"type"`
Dynamic bool `json:"dynamic"`
Location Location `json:"location"`
}
GraphEdge represents an edge in the code graph (function call or dependency)
type GraphNode ¶
type GraphNode struct {
ID string `json:"id"`
Name string `json:"name"`
Package string `json:"package"`
File string `json:"file"`
Line int `json:"line"`
Column int `json:"column"`
Type NodeType `json:"type"`
Exported bool `json:"exported"`
Complexity int `json:"complexity,omitempty"`
}
GraphNode represents a node in the code graph (function, method, or type)
type ImportInfo ¶
type ImportInfo struct {
Path string `json:"path"`
Name string `json:"name,omitempty"`
Alias string `json:"alias,omitempty"`
Kind ImportKind `json:"kind"`
}
ImportInfo represents an import statement
type ImportKind ¶
type ImportKind string
ImportKind represents how an import is used
const ( ImportKindNormal ImportKind = "normal" ImportKindAlias ImportKind = "alias" ImportKindDot ImportKind = "dot" ImportKindBlank ImportKind = "blank" )
type IssueCategory ¶
type IssueCategory string
IssueCategory represents the category of an issue
const ( IssueCategoryBug IssueCategory = "bug" IssueCategoryCodeSmell IssueCategory = "code_smell" IssueCategorySecurity IssueCategory = "security" IssueCategoryPerformance IssueCategory = "performance" IssueCategoryComplexity IssueCategory = "complexity" IssueCategoryUnused IssueCategory = "unused" IssueCategoryDeprecated IssueCategory = "deprecated" IssueCategoryStyle IssueCategory = "style" )
type IssueSeverity ¶
type IssueSeverity string
IssueSeverity represents the severity of an issue
const ( IssueSeverityInfo IssueSeverity = "info" IssueSeverityWarning IssueSeverity = "warning" IssueSeverityError IssueSeverity = "error" )
type Location ¶
type Location struct {
File string `json:"file"`
Line int `json:"line"`
Column int `json:"column"`
}
Location represents a source location
type ReferenceInfo ¶
type ReferenceInfo struct {
Symbol string `json:"symbol"`
Location Location `json:"location"`
Kind RefKind `json:"kind"`
}
ReferenceInfo represents a reference to a symbol
type SymbolInfo ¶
type SymbolInfo struct {
Name string `json:"name"`
Kind SymbolKind `json:"kind"`
Location Location `json:"location"`
Signature string `json:"signature,omitempty"`
Doc string `json:"doc,omitempty"`
Exported bool `json:"exported"`
Complexity int `json:"complexity,omitempty"`
}
SymbolInfo represents information about a code symbol
type SymbolKind ¶
type SymbolKind string
SymbolKind represents the kind of a symbol
const ( SymbolKindPackage SymbolKind = "package" SymbolKindImport SymbolKind = "import" SymbolKindConst SymbolKind = "const" SymbolKindVar SymbolKind = "var" SymbolKindType SymbolKind = "type" SymbolKindFunc SymbolKind = "func" SymbolKindMethod SymbolKind = "method" SymbolKindField SymbolKind = "field" SymbolKindInterface SymbolKind = "interface" )