openai/openai-builder-lab-solution
Duplication Places in code with 6 or more lines that are exactly the same. |
Duplication Overall
- 85% duplication:
- 5,523 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
- 4,700 duplicated lines
- 357 duplicates
Duplication per Extension
Duplication per Component (primary)
Duplication Between Components (50+ lines)
flowchart TB
n0["challenge4"]
n1["challenge5"]
n2["challenge3"]
n3["challenge2"]
n4["challenge1"]
n5["starting_point"]
n0 ---|"1811"| n1
n2 ---|"1716"| n0
n2 ---|"1495"| n1
n3 ---|"1456"| n2
n3 ---|"1452"| n0
n3 ---|"1231"| n1
n4 ---|"1170"| n3
n4 ---|"1170"| n2
n4 ---|"1168"| n0
n4 ---|"1150"| n5
n2 ---|"1130"| n5
n3 ---|"1130"| n5
n0 ---|"1128"| n5
n4 ---|"1009"| n1
n1 ---|"993"| n5
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:#DC143CED,stroke-width:9px
linkStyle 2 stroke:#DC143CDB,stroke-width:8px
linkStyle 3 stroke:#DC143CDB,stroke-width:8px
linkStyle 4 stroke:#DC143CDB,stroke-width:8px
linkStyle 5 stroke:#DC143CB7,stroke-width:6px
linkStyle 6 stroke:#DC143CB7,stroke-width:6px
linkStyle 7 stroke:#DC143CB7,stroke-width:6px
linkStyle 8 stroke:#DC143CB7,stroke-width:6px
linkStyle 9 stroke:#DC143CB7,stroke-width:6px
linkStyle 10 stroke:#DC143CB7,stroke-width:6px
linkStyle 11 stroke:#DC143CB7,stroke-width:6px
linkStyle 12 stroke:#DC143CB7,stroke-width:6px
linkStyle 13 stroke:#DC143CA5,stroke-width:5px
linkStyle 14 stroke:#DC143CA5,stroke-width:5px
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
challenge4 (87%)
  --> challenge5 (54%)
1811
23 file pairs
details...
challenge3 (99%)
  --> challenge4 (82%)
1716
23 file pairs
details...
challenge3 (86%)
  --> challenge5 (45%)
1495
21 file pairs
details...
challenge2 (98%)
  --> challenge3 (84%)
1456
20 file pairs
details...
challenge2 (98%)
  --> challenge4 (70%)
1452
20 file pairs
details...
challenge2 (83%)
  --> challenge5 (37%)
1231
18 file pairs
details...
challenge1 (94%)
  --> challenge2 (79%)
1170
16 file pairs
details...
challenge1 (94%)
  --> challenge3 (67%)
1170
16 file pairs
details...
challenge1 (94%)
  --> challenge4 (56%)
1168
16 file pairs
details...
challenge1 (93%)
  --> starting_point (93%)
1150
14 file pairs
details...
challenge3 (65%)
  --> starting_point (92%)
1130
14 file pairs
details...
challenge2 (76%)
  --> starting_point (92%)
1130
14 file pairs
details...
challenge4 (54%)
  --> starting_point (91%)
1128
14 file pairs
details...
challenge1 (81%)
  --> challenge5 (30%)
1009
15 file pairs
details...
challenge5 (30%)
  --> starting_point (80%)
993
14 file pairs
details...
flowchart TB
n0["challenge4"]
n1["challenge5"]
n2["challenge3"]
n3["challenge2"]
n4["challenge1"]
n5["starting_point"]
n0 ---|"1811"| n1
n2 ---|"1716"| n0
n2 ---|"1495"| n1
n3 ---|"1456"| n2
n3 ---|"1452"| n0
n3 ---|"1231"| n1
n4 ---|"1170"| n3
n4 ---|"1170"| n2
n4 ---|"1168"| n0
n4 ---|"1150"| n5
n2 ---|"1130"| n5
n3 ---|"1130"| n5
n0 ---|"1128"| n5
n4 ---|"1009"| n1
n1 ---|"993"| n5
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:#DC143CED,stroke-width:9px
linkStyle 2 stroke:#DC143CDB,stroke-width:8px
linkStyle 3 stroke:#DC143CDB,stroke-width:8px
linkStyle 4 stroke:#DC143CDB,stroke-width:8px
linkStyle 5 stroke:#DC143CB7,stroke-width:6px
linkStyle 6 stroke:#DC143CB7,stroke-width:6px
linkStyle 7 stroke:#DC143CB7,stroke-width:6px
linkStyle 8 stroke:#DC143CB7,stroke-width:6px
linkStyle 9 stroke:#DC143CB7,stroke-width:6px
linkStyle 10 stroke:#DC143CB7,stroke-width:6px
linkStyle 11 stroke:#DC143CB7,stroke-width:6px
linkStyle 12 stroke:#DC143CB7,stroke-width:6px
linkStyle 13 stroke:#DC143CA5,stroke-width:5px
linkStyle 14 stroke:#DC143CA5,stroke-width:5px
Show more details on duplication between components...
| From Component --> To Component |
Duplicated Lines |
File Pairs | Details |
|---|---|---|---|
| challenge4 (87%)   --> challenge5 (54%) |
1811 | 23 file pairs | details... |
| challenge3 (99%)   --> challenge4 (82%) |
1716 | 23 file pairs | details... |
| challenge3 (86%)   --> challenge5 (45%) |
1495 | 21 file pairs | details... |
| challenge2 (98%)   --> challenge3 (84%) |
1456 | 20 file pairs | details... |
| challenge2 (98%)   --> challenge4 (70%) |
1452 | 20 file pairs | details... |
| challenge2 (83%)   --> challenge5 (37%) |
1231 | 18 file pairs | details... |
| challenge1 (94%)   --> challenge2 (79%) |
1170 | 16 file pairs | details... |
| challenge1 (94%)   --> challenge3 (67%) |
1170 | 16 file pairs | details... |
| challenge1 (94%)   --> challenge4 (56%) |
1168 | 16 file pairs | details... |
| challenge1 (93%)   --> starting_point (93%) |
1150 | 14 file pairs | details... |
| challenge3 (65%)   --> starting_point (92%) |
1130 | 14 file pairs | details... |
| challenge2 (76%)   --> starting_point (92%) |
1130 | 14 file pairs | details... |
| challenge4 (54%)   --> starting_point (91%) |
1128 | 14 file pairs | details... |
| challenge1 (81%)   --> challenge5 (30%) |
1009 | 15 file pairs | details... |
| challenge5 (30%)   --> starting_point (80%) |
993 | 14 file pairs | 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 10 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."