Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildOptions ¶
type BuildOptions struct {
// MaxDepth is the maximum number of path segments a module name may have.
// Deeper paths are collapsed to their ancestor. Defaults to 4 when 0.
MaxDepth int
// MaxModules caps how many modules are retained. 0 means no cap.
MaxModules int
}
BuildOptions configures the behaviour of Build.
type Graph ¶
type Graph struct {
// contains filtered or unexported fields
}
Graph holds the full dependency graph built from parsed files.
func Build ¶
func Build(files []*parser.FileInfo, opts BuildOptions) *Graph
Build constructs a dependency Graph from a slice of parsed FileInfo.
func (*Graph) Entrypoints ¶
Entrypoints returns file paths that were flagged as IsEntrypoint.
func (*Graph) Isolated ¶
Isolated returns the names of modules that have no incoming and no outgoing dependency edges, sorted alphabetically.
func (*Graph) MostDepended ¶
MostDepended returns module names sorted by DependedBy count descending. Ties are broken alphabetically.
type Module ¶
type Module struct {
Name string
FileCount int
Files []string // basenames of files in this module
Exports []string
TypeDefs map[string]string
DependsOn []string
DependedBy []string
Languages []string
PrimaryLanguage string
LineCount int
// contains filtered or unexported fields
}
Module represents a logical grouping of source files by directory.
Click to show internal directories.
Click to hide internal directories.