Duplicate Code
Duplicate code refers to code that appears more than once in a codebase. This can make maintenance harder and increase the risk of bugs.
Code :
![](img/duplicateCode-before.png)
Treatment:
Refactor the code to remove duplication.
![](img/duplicateCode-after.png)
Duplicate Code
Duplicate code refers to code that appears more than once in a codebase. This can make maintenance harder and increase the risk of bugs.
Code :
Treatment:
Refactor the code to remove duplication.