ModuleDependencyGraph
The complete module dependency graph for a Gradle project.
This is the central data structure that flows through the entire Aalekh pipeline:
Gradle Project Model
→ aalekh-gradle extraction (AalekhExtractTask)
→ ModuleDependencyGraph (this class)
→ RuleEngine → List<Violation>
→ HtmlReportGenerator / JUnitXmlWriter / JsonReporter / SarifReporterAll fields are serializable to JSON for tooling interoperability and configuration-cache compatibility. All operations are pure - no I/O, no mutation.
Parameters
Root project name from settings.gradle.kts
All subproject modules discovered in the build
All inter-module dependency relationships
All declared external (third-party) dependencies, keyed by declaring module via ExternalDependency.module. Empty when external-dependency capture is disabled or when deserializing a graph file produced by an older plugin version.
How the project is built rather than how it is wired: plugins and their versions, version catalogs, toolchains, KMP targets, test layout, CODEOWNERS, and any metadata the team declared in .aalekh/modules.json. BuildInventory.EMPTY when deserializing a graph file produced by an older plugin version.
Build context: Gradle version, AGP version, extraction timestamp, etc.
Constructors
Properties
Functions
All edges leaving a module (what it directly depends on).
All edges arriving at a module (what directly depends on it).
All external (third-party) dependencies declared by a module.
Finds all cycles in the graph and returns them as lists of module paths. Returns an empty list if the graph is acyclic.
Instability index: fanOut / (fanIn + fanOut). Range: 0.0 (maximally stable) to 1.0 (maximally unstable). Core/domain modules should be near 0.0; leaf feature modules near 1.0.
Finds a module by its Gradle project path, or null if not found.
Number of transitively reachable modules from path.