codeintel

package
v0.0.0-...-ae3ab5d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

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 DepType

type DepType string

DepType represents the type of dependency

const (
	DepTypeImport   DepType = "import"
	DepTypeCall     DepType = "call"
	DepTypeEmbedded DepType = "embedded"
)

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 EdgeType

type EdgeType string

EdgeType represents the type of a graph edge

const (
	EdgeTypeCall       EdgeType = "call"
	EdgeTypeDependency EdgeType = "dependency"
	EdgeTypeImport     EdgeType = "import"
)

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

type FunctionNode struct {
	Func *ast.FuncDecl
	Pos  token.Pos
	End  token.Pos
}

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 NodeType

type NodeType string

NodeType represents the type of a graph node

const (
	NodeTypeFunction NodeType = "function"
	NodeTypeMethod   NodeType = "method"
	NodeTypeType     NodeType = "type"
	NodeTypePackage  NodeType = "package"
)

type RefKind

type RefKind string

RefKind represents the kind of reference

const (
	RefKindDefinition RefKind = "definition"
	RefKindReference  RefKind = "reference"
	RefKindCall       RefKind = "call"
)

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"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL