Identifying occurrence of massive copy-paste


#1

Problem
When a developer adds (comparably) a big number of duplicated lines of code that could be a risk indicator for copy-pasting code instead of programming. Code that is copy-pasted requires a manual update when a variable within is changed. That could lead to increase in maintainability costs and a possibility of creating bugs after changes occur.

Situation

On the top chart, we see 2 points in time when copy-paste occurred. The 1st occurrence massively increased a number of duplicates on the project. This led to the sizeable increase in Tech Debt highlighting that code with the vast amount of issues was duplicated (bottom chart).

Action

  1. Found out a reason, why duplicates sharply increased 2 times.
  2. Stress on the 1st event that led to increase in the amount of technical debt.
  3. Estimate a possibility of code refactoring based on a potential harm that duplicated code could cause.

Benefits

  1. Recognition of a potential malpractice (or a conscious move to cut time) that could lead to an increase in maintenance costs and decrease code readability.
  2. Show developer that the manager has effective tools for the control.