Precision tools on a drafting table.
Blog chevron_right How Deslop ranks duplicate-code clusters

How Deslop ranks duplicate-code clusters

Updated for 0.35.0. The earlier ranking multiplied by a logarithmic byte-span term; current ranking uses duplicated mass alone.

The formula

mass = canonical_node_count × max(visible_members − 1, 0)

The first factor measures the syntax-tree size of the reference occurrence. The second counts additional visible copies. More copied code and more copies mean more duplicated mass.

Clones appear in descending mass order, with stable IDs breaking ties. Same shape, different content is informational: it has zero duplicated mass, no clone rank, and appears after clones.

Mass does not measure confidence or extraction safety. It does not include language, file history, byte span or a similarity multiplier. Duplication percentage separately measures the union of covered source lines.

The contract is Rank by duplicated mass; report ordering is implemented in report_weight.rs.