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."
- 35% duplication:
- 1,626 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
- 582 duplicated lines
- 23 duplicates
Size | # | Folders | Files | Lines | Code |
43 |
x 2 |
ROOTROOT |
|
353:403 (10%)302:352 (11%) |
view |
42 |
x 2 |
ROOTROOT |
|
135:182 (10%)104:151 (11%) |
view |
36 |
x 2 |
ROOTROOT |
|
297:338 (8%)248:289 (9%) |
view |
35 |
x 2 |
ROOTROOT |
|
452:489 (8%)400:437 (9%) |
view |
28 |
x 2 |
ROOTROOT |
|
68:101 (6%)68:101 (7%) |
view |
27 |
x 2 |
ROOTROOT |
|
205:238 (6%)174:207 (7%) |
view |
18 |
x 2 |
ROOTROOT |
|
269:288 (4%)221:240 (4%) |
view |
17 |
x 2 |
ROOTROOT |
|
407:424 (4%)356:373 (4%) |
view |
17 |
x 2 |
ROOTROOT |
|
184:202 (4%)153:171 (4%) |
view |
15 |
x 2 |
ROOTROOT |
|
429:448 (3%)378:397 (3%) |
view |
11 |
x 2 |
ROOTROOT |
|
491:504 (2%)444:457 (2%) |
view |
9 |
x 2 |
ROOTROOT |
|
199:208 (2%)281:290 (2%) |
view |
9 |
x 2 |
ROOTROOT |
|
230:239 (2%)330:339 (2%) |
view |
8 |
x 2 |
ROOTROOT |
|
230:238 (1%)281:289 (2%) |
view |
8 |
x 2 |
ROOTROOT |
|
330:338 (1%)199:207 (2%) |
view |
6 |
x 2 |
ROOTROOT |
|
214:219 (1%)263:268 (1%) |
view |
6 |
x 2 |
ROOTROOT |
|
214:219 (1%)312:317 (1%) |
view |
6 |
x 2 |
ROOTROOT |
|
163:168 (1%)230:235 (1%) |
view |
6 |
x 2 |
ROOTROOT |
|
278:283 (1%)163:168 (1%) |
view |
6 |
x 2 |
ROOTROOT |
|
194:199 (1%)278:283 (1%) |
view |
Size | # | Folders | Files | Lines | Code |
13 |
x 2 |
ROOTROOT |
|
0:0 0:0 |
view |
12 |
x 2 |
ROOTROOT |
|
0:0 0:0 |
view |
10 |
x 2 |
ROOTROOT |
|
0:0 0:0 |
view |
9 |
x 2 |
ROOTROOT |
|
0:0 0:0 |
view |
8 |
x 2 |
ROOTROOT |
|
0:0 0:0 |
view |