Skip to main content

infer_modules

Function infer_modules 

Source
pub fn infer_modules(
    file_imports: &[(String, String)],
    all_files: &[String],
    depth: Option<usize>,
) -> Vec<Module>
Expand description

Infer modules from file-level import edges.

Algorithm:

  1. Auto-detect directory depth (elbow method) or use provided depth
  2. Group files by directory at that depth
  3. For each group with LCOM4 > 1: recursively split into subdirectories
  4. For large groups with LCOM4 = 1 but ICR < 0.30: split one level