Skip to main content

Module extractor

Module extractor 

Expand description

Per-file function extraction + clone grouping.

Given the source of one Tier-1 file, find every function-shaped subtree, fingerprint each, and return FunctionFingerprint records. The grouper (next layer up) consumes these across all files and emits clone families by fingerprint.digest equality.

Structs§

CloneGroup
One clone family: a fingerprint shared by ≥ 2 members.
FunctionFingerprint
One function found in one file at one rev, with its structural fingerprint.

Functions§

extract_functions
Parse code for lang and return one FunctionFingerprint per function- shaped node. The min-fragment-size filter is applied by the caller against fingerprint.node_count so callers can tune it per-run.
group_clones
Group function-fingerprints by digest, return families of size ≥ 2. min_node_count filters out trivial functions (default 30 ≈ 5-8 statements of structural shape after identifier/literal normalization).