Skip to main content

build_module_graph

Function build_module_graph 

Source
pub fn build_module_graph(
    project_root: &Path,
    parsed_files: &[ProjectFile],
    branch_id: &BranchId,
) -> ModuleGraph
Expand description

Analyze parsed files to detect module structure and build a dependency graph.

§Arguments

  • project_root - The root directory of the project (used to compute relative paths).
  • parsed_files - All parsed ProjectFiles from the scanning pipeline.
  • branch_id - The branch identifier for the knowledge graph nodes and edges.

§Returns

A ModuleGraph containing:

  • Knowledge nodes (Fact nature, Info weight) for each detected module.
  • DependsOn edges between modules based on import relationships.
  • PartOf edges from submodules to their parent modules.