This site uses cookies from Google to deliver and enhance the quality of its services and to analyse traffic.Learn moreOK, got it

Repeated code

IDFCNS-9
TitleDo not use the same block of code more than once in a function/in multiple functions.
PriorityStrongly recommended
Severity level4
DescriptionIf a function contains a block of code that is repeated more than one time, refactor it into a single function.
RationaleRefactoring of repeated blocks of code into single functions increases the maintainability, readability and reusability of the code.