Places in code with 6 or more lines that are exactly the same.
- For duplication, we look at places in code where there are 6 or more lines of code that are exactly the same.
- Before duplication is calculated, the code is cleaned to remove empty lines, comments, and frequently duplicated constructs such as imports.
- You should aim at having as little as possible (<5%) of duplicated code as high-level of duplication can lead to maintenance difficulties, poor factoring, and logical contradictions.
Learn more...
- To learn more about duplications and techniques for eliminating duplication, Sokrates recommends the following resources:
- Avoid Repetition, MartinFlower.com (IEEE Software article)
- Refactoring duplicated code, sourcemaking.com
- Beck Design Rules, MartinFowler.com
- DRY (Don't Repeat Yourself) Principle, Wikipedia
- The Cut-and-Paste Programming Software Development Anti-Pattern, sourcemaking.com
- Code Smells / Duplicated Code, Jeff Atwood, codinghorror.com:
- "Duplicated code is the bane of software development. Stamp out duplication whenever possible. You should always be on the lookout for more subtle cases of near-duplication, too. Don't Repeat Yourself!"
- Reducing Coupling, MartinFlower.com (IEEE Software article):
- "There are several ways to describe coupling, but it boils down to this: If changing one module in a program requires changing another module, then coupling exists. ... Duplication always implies coupling, because changing one piece of duplicate code implies changing the other."
Size | # | Folders | Files | Lines | Code |
7 |
x 2 |
src/tablessrc/tables |
|
70:76 (5%)73:79 (6%) |
view |
7 |
x 2 |
src/tablessrc/tables |
|
50:56 (5%)33:39 (6%) |
view |
7 |
x 2 |
src/tablessrc/tables |
|
115:121 (5%)38:44 (6%) |
view |
7 |
x 2 |
src/tablessrc/tables |
|
90:96 (5%)108:114 (6%) |
view |
7 |
x 2 |
src/tablessrc/tables |
|
120:126 (5%)113:119 (6%) |
view |
6 |
x 2 |
srcsrc |
|
37:42 (7%)66:71 (7%) |
view |
6 |
x 2 |
src/tablessrc/tables |
|
105:110 (4%)118:123 (5%) |
view |