aws-samples / aws-serverless-shopping-cart
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
  • 17% duplication:
    • 2,174 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 383 duplicated lines
  • 33 duplicates
system17% (383 lines)
Duplication per Extension
py35% (175 lines)
yaml19% (132 lines)
vue8% (44 lines)
js7% (32 lines)
Duplication per Component (primary)
backend/shopping-cart-service39% (157 lines)
backend24% (125 lines)
frontend/src8% (76 lines)
backend/product-mock-service42% (18 lines)
amplify-ci4% (7 lines)
frontend0% (0 lines)
frontend/public0% (0 lines)
frontend/scripts0% (0 lines)
ROOT0% (0 lines)
backend/layers0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 33 duplicates...
Size#FoldersFilesLinesCode
24 x 2 backend/shopping-cart-service
backend/shopping-cart-service
add_to_cart.py
update_cart.py
8:41 (26%)
8:41 (31%)
view
13 x 2 frontend/src/components
frontend/src/components
CartButton.vue
CartButton.vue
33:47 (23%)
50:64 (23%)
view
12 x 2 backend
backend
shoppingcart-service.yaml
shoppingcart-service.yaml
209:220 (2%)
231:242 (2%)
view
11 x 2 backend
backend
shoppingcart-service.yaml
shoppingcart-service.yaml
77:87 (2%)
90:100 (2%)
view
11 x 2 backend/shopping-cart-service
backend/shopping-cart-service
list_cart.py
migrate_cart.py
48:60 (28%)
100:112 (15%)
view
9 x 2 frontend/src
frontend/src/components
App.vue
CartDrawer.vue
65:75 (14%)
52:62 (20%)
view
9 x 2 backend/shopping-cart-service
backend/shopping-cart-service
add_to_cart.py
add_to_cart.py
74:82 (10%)
92:100 (10%)
view
9 x 2 backend/product-mock-service
backend/product-mock-service
get_product.py
get_products.py
10:21 (39%)
10:21 (50%)
view
8 x 2 frontend/src/store
frontend/src/store
actions.js
actions.js
52:59 (6%)
80:87 (6%)
view
8 x 2 frontend/src/backend
frontend/src/backend
api.js
api.js
40:47 (12%)
53:60 (12%)
view
7 x 2 backend/shopping-cart-service
backend/shopping-cart-service
add_to_cart.py
update_cart.py
44:53 (7%)
47:56 (9%)
view
7 x 2 backend/shopping-cart-service
backend/shopping-cart-service
get_cart_total.py
list_cart.py
9:18 (38%)
10:19 (18%)
view
7 x 2 backend/shopping-cart-service
backend/shopping-cart-service
checkout_cart.py
migrate_cart.py
20:32 (18%)
43:55 (10%)
view
7 x 2 amplify-ci
backend
amplify-template.yaml
shoppingcart-service.yaml
25:31 (4%)
395:401 (1%)
view
7 x 2 backend/shopping-cart-service
backend/shopping-cart-service
checkout_cart.py
migrate_cart.py
33:42 (18%)
57:66 (10%)
view
7 x 2 backend/shopping-cart-service
backend/shopping-cart-service
delete_from_cart.py
get_cart_total.py
7:16 (43%)
9:18 (38%)
view
7 x 2 backend/shopping-cart-service
backend/shopping-cart-service
delete_from_cart.py
list_cart.py
7:16 (43%)
10:19 (18%)
view
6 x 2 backend
backend
shoppingcart-service.yaml
shoppingcart-service.yaml
127:132 (1%)
149:154 (1%)
view
6 x 2 backend
backend
shoppingcart-service.yaml
shoppingcart-service.yaml
210:215 (1%)
254:259 (1%)
view
6 x 2 backend
backend
shoppingcart-service.yaml
shoppingcart-service.yaml
261:266 (1%)
286:291 (1%)
view
Duplicated Units
The list of top 1 duplicated units.
See data for all 1 unit duplicate
Size#FoldersFilesLinesCode
7 x 2 frontend/src/backend
frontend/src/backend
api.js
api.js
71:78 
80:87 
view