Duplication Overall
- 17% duplication:
- 8,035 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
- 1,401 duplicated lines
- 194 duplicates
Duplication per Extension
Duplication per Component (primary)
Duplication Between Components (50+ lines)
flowchart TB
n0["collectionscanner"]
n1["unclognearline"]
n2["cronscanner"]
n3["deletescanner"]
n4["common"]
n5["archivescanner"]
n6["nearlinescanner"]
n7["remove-archived-nearline"]
n0 ---|"150"| n1
n2 ---|"131"| n3
n3 ---|"128"| n1
n4 ---|"115"| n1
n0 ---|"112"| n3
n0 ---|"92"| n2
n2 ---|"92"| n1
n5 ---|"56"| n6
n5 ---|"54"| n7
n3 ---|"52"| n6
classDef default fill:#00b2ee,stroke:#ffffff,color:#000000;
classDef highlighted fill:#00b2ee,stroke:#ffffff,color:#000000;
linkStyle 0 stroke:#DC143CFF,stroke-width:10px
linkStyle 1 stroke:#DC143CDB,stroke-width:8px
linkStyle 2 stroke:#DC143CDB,stroke-width:8px
linkStyle 3 stroke:#DC143CC9,stroke-width:7px
linkStyle 4 stroke:#DC143CC9,stroke-width:7px
linkStyle 5 stroke:#DC143CB7,stroke-width:6px
linkStyle 6 stroke:#DC143CB7,stroke-width:6px
linkStyle 7 stroke:#DC143C82,stroke-width:3px
linkStyle 8 stroke:#DC143C82,stroke-width:3px
linkStyle 9 stroke:#DC143C82,stroke-width:3px
Download:
Mermaid (.mmd)
(open online Mermaid editor)
2D force graph
|
3D force graph
Show more details on duplication between components...
From Component
--> To Component
Duplicated
Lines
File Pairs
Details
collectionscanner (22%)
  --> unclognearline (22%)
150
2 file pairs
details...
cronscanner (34%)
  --> deletescanner (56%)
131
1 file pair
details...
deletescanner (55%)
  --> unclognearline (19%)
128
1 file pair
details...
common (2%)
  --> unclognearline (17%)
115
11 file pairs
details...
collectionscanner (16%)
  --> deletescanner (48%)
112
1 file pair
details...
collectionscanner (13%)
  --> cronscanner (24%)
92
1 file pair
details...
cronscanner (24%)
  --> unclognearline (14%)
92
1 file pair
details...
archivescanner (12%)
  --> nearlinescanner (27%)
56
1 file pair
details...
archivescanner (12%)
  --> remove-archived-nearline (7%)
54
1 file pair
details...
deletescanner (22%)
  --> nearlinescanner (25%)
52
1 file pair
details...
flowchart TB
n0["collectionscanner"]
n1["unclognearline"]
n2["cronscanner"]
n3["deletescanner"]
n4["common"]
n5["archivescanner"]
n6["nearlinescanner"]
n7["remove-archived-nearline"]
n0 ---|"150"| n1
n2 ---|"131"| n3
n3 ---|"128"| n1
n4 ---|"115"| n1
n0 ---|"112"| n3
n0 ---|"92"| n2
n2 ---|"92"| n1
n5 ---|"56"| n6
n5 ---|"54"| n7
n3 ---|"52"| n6
classDef default fill:#00b2ee,stroke:#ffffff,color:#000000;
classDef highlighted fill:#00b2ee,stroke:#ffffff,color:#000000;
linkStyle 0 stroke:#DC143CFF,stroke-width:10px
linkStyle 1 stroke:#DC143CDB,stroke-width:8px
linkStyle 2 stroke:#DC143CDB,stroke-width:8px
linkStyle 3 stroke:#DC143CC9,stroke-width:7px
linkStyle 4 stroke:#DC143CC9,stroke-width:7px
linkStyle 5 stroke:#DC143CB7,stroke-width:6px
linkStyle 6 stroke:#DC143CB7,stroke-width:6px
linkStyle 7 stroke:#DC143C82,stroke-width:3px
linkStyle 8 stroke:#DC143C82,stroke-width:3px
linkStyle 9 stroke:#DC143C82,stroke-width:3px
Show more details on duplication between components...
| From Component --> To Component |
Duplicated Lines |
File Pairs | Details |
|---|---|---|---|
| collectionscanner (22%)   --> unclognearline (22%) |
150 | 2 file pairs | details... |
| cronscanner (34%)   --> deletescanner (56%) |
131 | 1 file pair | details... |
| deletescanner (55%)   --> unclognearline (19%) |
128 | 1 file pair | details... |
| common (2%)   --> unclognearline (17%) |
115 | 11 file pairs | details... |
| collectionscanner (16%)   --> deletescanner (48%) |
112 | 1 file pair | details... |
| collectionscanner (13%)   --> cronscanner (24%) |
92 | 1 file pair | details... |
| cronscanner (24%)   --> unclognearline (14%) |
92 | 1 file pair | details... |
| archivescanner (12%)   --> nearlinescanner (27%) |
56 | 1 file pair | details... |
| archivescanner (12%)   --> remove-archived-nearline (7%) |
54 | 1 file pair | details... |
| deletescanner (22%)   --> nearlinescanner (25%) |
52 | 1 file pair | details... |
Longest Duplicates
The list of 50 longest duplicates.
Most Frequent Duplicates
The list of 50 most frequently found duplicates.
Duplicated Units
The list of top 4 duplicated units.
About This Analysis
- 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."