1. Software Engineering
  2. Code Quality

Code Duplication

Percentage

Quantifies the amount of duplicated code in a codebase. High duplication can lead to larger codebases, making maintenance more challenging and increasing the potential for errors.

Formula

(Duplicated Lines of Code / Total Lines of Code) * 100

Example

If a project has 1,000 lines of code with 100 lines duplicated, the code duplication rate is (100/1000)*100 = 10%.