Documentation
¶
Overview ¶
Package deps runs dependency-structure analysis on the files changed in a diff. It relies on a language-supplied lang.ImportResolver to turn source files into the adjacency map the graph algorithms operate on.
graph.go contains the pure-math primitives: cycle detection, coupling, instability, SDP violation detection. deps.go wires them up to an ImportResolver and builds a report.Section. Splitting the two makes the graph algorithms reusable for any language without dragging the orchestration (module-path detection, section formatting) along.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Graph ¶
Graph represents an internal package dependency graph. Nodes are package-level identifiers (typically the module path plus the package directory, e.g. "example.com/mod/internal/foo"). Edges point from importer to importee.
type PackageMetrics ¶
PackageMetrics holds coupling and instability metrics for a package. Afferent = how many other packages import this one ("fan-in"). Efferent = how many other packages this one imports ("fan-out"). Instability = Efferent / (Afferent + Efferent), range [0,1].