anthropics / agent-sdk-workshop
Duplication

Places in code with 6 or more lines that are exactly the same.

Intro
  • 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...
Duplication Overall
  • 9% duplication:
    • 1,592 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 147 duplicated lines
  • 14 duplicates
system9% (147 lines)
dependency graphs: 2D graph | 2D graph (with duplicates)... | 3D graph | 3D graph (with duplicates)...
Duplication per Extension
py9% (147 lines)
Duplication per Component (primary)
01-guided-demo15% (83 lines)
02-breakouts7% (64 lines)
ROOT0% (0 lines)
extend0% (0 lines)

Duplication Between Components (50+ lines)

flowchart TB
    n0["01-guided-demo"]
    n1["02-breakouts"]
    n0 ---|"104"| n1
    classDef default fill:#00b2ee,stroke:#ffffff,color:#000000;
    classDef highlighted fill:#00b2ee,stroke:#ffffff,color:#000000;
    linkStyle 0 stroke:#DC143CFF,stroke-width:10px


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
01-guided-demo (9%)
  --> 02-breakouts (5%)
104 2 file pairs details...

Longest Duplicates
The list of 14 longest duplicates.
See data for all 14 duplicates...
Size#FoldersFilesLinesCode
9 x 2 01-guided-demo
02-breakouts/_shared
398:406 (4%)
287:295 (4%)
view
9 x 2 01-guided-demo
02-breakouts/_shared
303:313 (4%)
214:222 (4%)
view
8 x 2 01-guided-demo
02-breakouts/_shared
64:75 (3%)
47:56 (4%)
view
8 x 2 01-guided-demo
01-guided-demo
152:160 (4%)
191:199 (4%)
view
8 x 2 01-guided-demo
01-guided-demo
114:122 (4%)
191:199 (4%)
view
8 x 2 01-guided-demo
01-guided-demo
114:122 (4%)
152:160 (4%)
view
7 x 2 01-guided-demo
01-guided-demo
70:76 (4%)
154:160 (4%)
view
7 x 2 01-guided-demo
02-breakouts/_shared
23:32 (3%)
26:35 (3%)
view
7 x 2 01-guided-demo
02-breakouts/_shared
316:327 (3%)
224:231 (3%)
view
7 x 2 01-guided-demo
01-guided-demo
70:76 (4%)
116:122 (4%)
view
7 x 2 01-guided-demo
01-guided-demo
70:76 (4%)
193:199 (4%)
view
6 x 2 02-breakouts/account-intelligence
02-breakouts/customer-support
23:29 (31%)
23:29 (31%)
view
6 x 2 01-guided-demo
02-breakouts/_shared
335:340 (2%)
238:243 (3%)
view
6 x 2 01-guided-demo
02-breakouts/_shared
91:97 (6%)
580:585 (1%)
view
Most Frequent Duplicates
The list of 3 most frequently found duplicates.
Size#FoldersFilesLinesCode
6 x 4 01-guided-demo
01-guided-demo
01-guided-demo
01-guided-demo
71:76 (3%)
117:122 (3%)
155:160 (3%)
194:199 (3%)
view
6 x 4 01-guided-demo
01-guided-demo
01-guided-demo
01-guided-demo
70:75 (3%)
116:121 (3%)
154:159 (3%)
193:198 (3%)
view
6 x 3 01-guided-demo
01-guided-demo
01-guided-demo
114:120 (3%)
152:158 (3%)
191:197 (3%)
view