aws-samples / aws-serverless-ecommerce-platform
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
  • 46% duplication:
    • 8,125 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 3,745 duplicated lines
  • 908 duplicates
system46% (3,745 lines)
Duplication per Extension
yaml53% (3,078 lines)
py21% (366 lines)
ts63% (271 lines)
graphql16% (30 lines)
Duplication per Component (primary)
orders44% (634 lines)
payment60% (583 lines)
warehouse62% (529 lines)
delivery67% (469 lines)
payment-3p65% (461 lines)
frontend-api37% (359 lines)
pipeline35% (254 lines)
products57% (206 lines)
platform27% (122 lines)
delivery-pricing39% (74 lines)
users35% (54 lines)
shared0% (0 lines)
ROOT0% (0 lines)

Duplication Between Components (50+ lines)

G delivery delivery warehouse warehouse delivery--warehouse 890 orders orders delivery--orders 728 payment payment delivery--payment 585 products products delivery--products 216 users users delivery--users 84 platform platform delivery--platform 76 orders--warehouse 724 orders--payment 759 orders--products 288 orders--users 104 orders--platform 94 payment--warehouse 603 payment--products 227 payment--platform 85 products--warehouse 226 products--users 108 payment-3p payment-3p payment-3p--payment 154 delivery-pricing delivery-pricing delivery-pricing--delivery 50 delivery-pricing--warehouse 50 delivery-pricing--orders 88 delivery-pricing--payment 128 delivery-pricing--products 116 delivery-pricing--payment-3p 90 users--warehouse 94 platform--warehouse 76 platform--products 76 platform--users 54 frontend-api frontend-api pipeline pipeline frontend-api--pipeline 91

Download: SVG DOT (open online Graphviz editor)

Open 3D force graph...

Show more details on duplication between components...
Longest Duplicates
The list of 20 longest duplicates.
See data for all 908 duplicates...
Size#FoldersFilesLinesCode
52 x 2 delivery
warehouse
template.yaml
template.yaml
362:413 (11%)
377:428 (11%)
view
41 x 2 payment-3p/resources
payment-3p/resources
openapi.yaml
openapi.yaml
59:99 (17%)
199:239 (17%)
view
40 x 2 delivery
warehouse
template.yaml
template.yaml
153:204 (8%)
170:221 (8%)
view
37 x 2 payment-3p/resources
payment-3p/resources
openapi.yaml
openapi.yaml
16:52 (15%)
154:190 (15%)
view
36 x 2 delivery
warehouse
template.yaml
template.yaml
445:481 (7%)
460:496 (7%)
view
32 x 2 products
warehouse
template.yaml
template.yaml
1:36 (21%)
1:36 (6%)
view
30 x 2 delivery
warehouse
template.yaml
template.yaml
322:351 (6%)
337:366 (6%)
view
30 x 2 delivery
warehouse
template.yaml
template.yaml
232:262 (6%)
248:278 (6%)
view
29 x 2 delivery
warehouse
template.yaml
template.yaml
415:443 (6%)
430:458 (6%)
view
29 x 2 warehouse/src/on_order_events
warehouse/src/table_update
main.py
main.py
78:112 (12%)
93:127 (29%)
view
25 x 2 payment-3p/resources
payment-3p/resources
openapi.yaml
openapi.yaml
28:52 (10%)
215:239 (10%)
view
25 x 2 delivery
warehouse
template.yaml
template.yaml
126:151 (5%)
139:164 (5%)
view
25 x 2 delivery
products
template.yaml
template.yaml
126:151 (5%)
103:128 (16%)
view
25 x 2 products
warehouse
template.yaml
template.yaml
103:128 (16%)
139:164 (5%)
view
25 x 2 payment-3p/resources
payment-3p/resources
openapi.yaml
openapi.yaml
75:99 (10%)
166:190 (10%)
view
25 x 2 users
warehouse
template.yaml
template.yaml
1:29 (29%)
1:29 (5%)
view
25 x 2 payment-3p/resources
payment-3p/resources
openapi.yaml
openapi.yaml
28:52 (10%)
75:99 (10%)
view
25 x 2 payment-3p/resources
payment-3p/resources
openapi.yaml
openapi.yaml
166:190 (10%)
215:239 (10%)
view
25 x 2 products
users
template.yaml
template.yaml
1:29 (16%)
1:29 (29%)
view
23 x 2 orders/src/table_update
products/src/table_update
main.py
main.py
15:54 (71%)
15:54 (71%)
view
Duplicated Units
The list of top 6 duplicated units.
See data for all 6 unit duplicates...
Size#FoldersFilesLinesCode
30 x 2 warehouse/src/table_update
warehouse/src/on_order_events
main.py
main.py
0:0 
0:0 
view
19 x 5 payment-3p/src/processPayment
payment-3p/src/check
payment-3p/src/preauth
payment-3p/src/cancelPayment
payment-3p/src/updateAmount
index.ts
index.ts
index.ts
index.ts
index.ts
6:25 
6:25 
8:27 
6:25 
7:26 
view
17 x 2 payment-3p/src/processPayment
payment-3p/src/cancelPayment
index.ts
index.ts
28:46 
28:46 
view
7 x 3 payment/src/on_modified
payment/src/on_completed
payment/src/on_failed
main.py
main.py
main.py
0:0 
0:0 
0:0 
view
7 x 4 warehouse/src/table_update
delivery/src/table_update
products/src/table_update
orders/src/table_update
main.py
main.py
main.py
main.py
0:0 
0:0 
0:0 
0:0 
view
6 x 2 payment/src/on_completed
payment/src/on_failed
main.py
main.py
0:0 
0:0 
view