Skip to main content

Module clones

Module clones 

Expand description

Clone detection.

Identifies Type 1 (exact) and Type 2 (renamed/parameterized) clones via AST structural hashing on tree-sitter parses. The fingerprint walks the AST in pre-order emitting (kind_name, child_count) pairs while skipping identifier, literal, and comment nodes — this normalization is what makes the hash Type 2-aware.

Optional Type 3 (near-miss) support via MinHash + LSH is not yet implemented.

The clone-coupling intersection — clone families that ALSO co-change at Fisher-significant rates — is the differentiating signal CodeScene calls “X-Ray”, with our published-formula transparency wedge applied.

Re-exports§

pub use extractor::CloneGroup;
pub use extractor::FunctionFingerprint;
pub use extractor::extract_functions;
pub use extractor::group_clones;
pub use fingerprint::Fingerprint;
pub use fingerprint::fingerprint_source;
pub use language::CloneLanguage;

Modules§

extractor
Per-file function extraction + clone grouping.
fingerprint
Structural AST fingerprinting for clone detection.
language
Per-language tree-sitter loader for clone fingerprinting.