intelligence

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderMermaid

func RenderMermaid(graph *DependencyGraph) string

RenderMermaid converts the dependency graph into a Mermaid flowchart format.

Types

type DependencyGraph

type DependencyGraph struct {
	Nodes []string
	Edges map[string][]string // Maps a package to the list of packages it imports
}

DependencyGraph represents the package-level dependency relationships.

func AnalyzeDependencies

func AnalyzeDependencies(ctx context.Context, path string) (*DependencyGraph, error)

AnalyzeDependencies parses the module and builds a graph of internal package dependencies.

type FunctionComplexity

type FunctionComplexity struct {
	PkgName    string
	FuncName   string
	FileName   string
	Line       int
	Complexity int
}

FunctionComplexity represents the cyclomatic complexity of a single Go function.

func AnalyzeComplexity

func AnalyzeComplexity(ctx context.Context, path string) ([]FunctionComplexity, error)

AnalyzeComplexity parses the module at the given path and calculates the cyclomatic complexity (McCabe's) of every function. It returns a slice of FunctionComplexity sorted from highest to lowest.

Jump to

Keyboard shortcuts

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