Skip to main content

compute_for_file

Function compute_for_file 

pub fn compute_for_file(
    path: &Path,
    source: Vec<u8>,
    lang: Tier1Language,
) -> Result<Vec<ComplexityEntity>>
Expand description

Compute complexity entities for a Tier-1 source file.

source is taken by value because every codelore-rca parser constructor consumes the byte buffer (*Parser::new(Vec<u8>, &Path, Option<…>)). The caller in facts/ingest.rs::ingest_complexity_at_head already owns a fresh Vec<u8> from Repo::read_blob_at_head, so the move is free; a &[u8] parameter would force a redundant .to_vec() per file (one full-source clone per Tier-1 file ingested at HEAD).