Skip to content

Duplication ​

Duplicate Block Count ​

duplication.duplicate_block_count — Number of duplicated token runs.

ItemValue
DefinitionNumber of duplicated token runs.
Scopefile, project
InputTokens (kind and text)
CalculationTokens are normalized (identifier -> $id, literal -> $lit, comments removed). Every window of 50 consecutive normalized tokens that occurs at least twice marks its tokens as duplicated; a maximal run of duplicated tokens is one block. File: clones within the file only. Project: clones across all files.
Unitcount
Language Applicabilitylanguage_independent
LimitationsRepetitive token sequences (e.g. long array literals) are reported as duplicates.
Reference-

Duplicate Token Count ​

duplication.duplicate_token_count — Number of duplicated tokens.

ItemValue
DefinitionNumber of duplicated tokens.
Scopefile, project
InputTokens (kind and text)
CalculationTokens are normalized (identifier -> $id, literal -> $lit, comments removed). Every window of 50 consecutive normalized tokens that occurs at least twice marks its tokens as duplicated; a maximal run of duplicated tokens is one block. File: clones within the file only. Project: clones across all files.
Unitcount
Language Applicabilitylanguage_independent
LimitationsRepetitive token sequences (e.g. long array literals) are reported as duplicates.
Reference-

Duplication Ratio ​

duplication.duplication_ratio — Duplicate Token Count / non-comment tokens; not_applicable when there are no tokens.

ItemValue
DefinitionDuplicate Token Count / non-comment tokens; not_applicable when there are no tokens.
Scopefile, project
InputTokens (kind and text)
CalculationTokens are normalized (identifier -> $id, literal -> $lit, comments removed). Every window of 50 consecutive normalized tokens that occurs at least twice marks its tokens as duplicated; a maximal run of duplicated tokens is one block. File: clones within the file only. Project: clones across all files.
Unitratio
Language Applicabilitylanguage_independent
LimitationsRepetitive token sequences (e.g. long array literals) are reported as duplicates.
Reference-

Maximum Duplicate Length ​

duplication.max_duplicate_length — Longest duplicated token run; 0 when there is none.

ItemValue
DefinitionLongest duplicated token run; 0 when there is none.
Scopefile, project
InputTokens (kind and text)
CalculationTokens are normalized (identifier -> $id, literal -> $lit, comments removed). Every window of 50 consecutive normalized tokens that occurs at least twice marks its tokens as duplicated; a maximal run of duplicated tokens is one block. File: clones within the file only. Project: clones across all files.
Unittokens
Language Applicabilitylanguage_independent
LimitationsRepetitive token sequences (e.g. long array literals) are reported as duplicates.
Reference-