Documentation
¶
Overview ¶
Package graph provides structural dependency analysis for code reviews. It builds and queries a graph of code units to identify blast-radius impacts and minimal review sets.
Index ¶
- type BlastRadiusResult
- type DependencyGraph
- func (g *DependencyGraph) AddEdge(from, to string, _ EdgeType)
- func (g *DependencyGraph) AddNode(node *Node)
- func (g *DependencyGraph) Build(ctx context.Context, modulePath string) error
- func (g *DependencyGraph) GetAllDependents(uri string) []string
- func (g *DependencyGraph) GetBlastRadius(files []string) *BlastRadiusResult
- func (g *DependencyGraph) GetDirectDependents(uri string) []string
- func (g *DependencyGraph) GetNode(uri string) *Node
- type EdgeType
- type Node
- type NodeType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlastRadiusResult ¶
type BlastRadiusResult struct {
Files []string `json:"files"`
Direct int `json:"direct"`
Transitive int `json:"transitive"`
MaxDepth int `json:"max_depth"`
ImpactScore float64 `json:"impact_score"`
}
BlastRadiusResult represents the results of a blast-radius analysis.
func (*BlastRadiusResult) Score ¶
func (b *BlastRadiusResult) Score() float64
Score computes an overall impact score.
type DependencyGraph ¶
type DependencyGraph struct {
// contains filtered or unexported fields
}
DependencyGraph represents structural dependencies between code units.
func (*DependencyGraph) AddEdge ¶
func (g *DependencyGraph) AddEdge(from, to string, _ EdgeType)
AddEdge adds a dependency edge between two nodes.
func (*DependencyGraph) AddNode ¶
func (g *DependencyGraph) AddNode(node *Node)
AddNode adds a node to the graph.
func (*DependencyGraph) Build ¶
func (g *DependencyGraph) Build(ctx context.Context, modulePath string) error
Build parses a Go module and builds the dependency graph.
func (*DependencyGraph) GetAllDependents ¶
func (g *DependencyGraph) GetAllDependents(uri string) []string
GetAllDependents returns all transitive dependents.
func (*DependencyGraph) GetBlastRadius ¶
func (g *DependencyGraph) GetBlastRadius(files []string) *BlastRadiusResult
GetBlastRadius returns files affected by changing the given files.
func (*DependencyGraph) GetDirectDependents ¶
func (g *DependencyGraph) GetDirectDependents(uri string) []string
GetDirectDependents returns direct dependents (outgoing edges).
func (*DependencyGraph) GetNode ¶
func (g *DependencyGraph) GetNode(uri string) *Node
GetNode returns a node by URI.