graph

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatGraphStats

func FormatGraphStats(stats map[string]any) string

FormatGraphStats returns a human-readable stats string.

Types

type Node

type Node struct {
	Path       string
	Language   string
	Size       int64
	Imports    []string
	Symbols    []string
	References []string
	ImportedBy []string
	Tags       []string
}

Node represents a file in the project graph.

type ProjectGraph

type ProjectGraph struct {
	// contains filtered or unexported fields
}

ProjectGraph represents the dependency graph of a project. Inspired by lean-ctx's ctx_graph.

func NewProjectGraph

func NewProjectGraph(rootDir string) *ProjectGraph

NewProjectGraph creates a new project graph.

func (*ProjectGraph) Analyze

func (g *ProjectGraph) Analyze() error

Analyze scans the project and builds the dependency graph.

func (*ProjectGraph) FindRelatedFiles

func (g *ProjectGraph) FindRelatedFiles(path string, maxResults int) []string

FindRelatedFiles finds files related to the given file through dependencies.

func (*ProjectGraph) ImpactAnalysis

func (g *ProjectGraph) ImpactAnalysis(path string) []string

ImpactAnalysis finds all files affected by a change to the given file.

func (*ProjectGraph) Stats

func (g *ProjectGraph) Stats() map[string]any

Stats returns project statistics.

Jump to

Keyboard shortcuts

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