Duplicated Lines of Code is one of the source-code metrics Understand computes across 17+ languages — browse them in the GUI, export and track them, or script them with the Python API.
Duplicated Lines of Code
API ID: DuplicateLinesOfCodeLanguages: Any
Targets: Architectures, Files, Project
The number of unique lines that are duplicated.
This metric plugin searches the entire project for duplicate lines. The number minimum number of lines to match and options to ignore whitespace and comments can be edited per project through the Project Configuration dialog metrics page.
See also the interactive report Duplicate Lines of Code and the check "Duplicate Lines of Code". There is also a blog article ↗ describing how duplicate lines are calculated. Duplicate lines of code are part of the Project Quality solution.