aws-samples / aws-bookstore-demo-app
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
  • 72% duplication:
    • 8,919 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 6,441 duplicated lines
  • 2,312 duplicates
system72% (6,441 lines)
Duplication per Extension
yaml91% (5,874 lines)
js65% (326 lines)
tsx16% (209 lines)
py24% (20 lines)
css2% (12 lines)
Duplication per Component (primary)
template91% (5,874 lines)
functions/APIs76% (338 lines)
assets/src/modules/signup18% (87 lines)
assets/src/modules/category25% (38 lines)
assets/src/modules/bestSellers20% (21 lines)
assets/src/modules/search13% (19 lines)
assets/src/modules/friends20% (14 lines)
assets/src/modules/checkout6% (12 lines)
assets/src/common/styles5% (12 lines)
assets/src/modules/pastPurchases8% (9 lines)
assets/src/modules/cart6% (9 lines)
functions/streaming16% (8 lines)
assets/src0% (0 lines)
assets/src/common/starRating0% (0 lines)
assets/src/common/friendRecommendations0% (0 lines)
assets/src/common/hero0% (0 lines)
assets/src/common0% (0 lines)
assets/src/modules/notFound0% (0 lines)
assets/public0% (0 lines)
functions/setup0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 2,312 duplicates...
Size#FoldersFilesLinesCode
1239 x 2 template
template
master-fullstack-with-lambda-warmers....
master-fullstack.yaml
1725:2970 (35%)
1258:2503 (41%)
view
452 x 2 template
template
master-fullstack-with-lambda-warmers....
master-fullstack.yaml
1259:1718 (12%)
790:1249 (15%)
view
311 x 2 template
template
master-fullstack-with-lambda-warmers....
master-fullstack.yaml
935:1256 (8%)
451:772 (10%)
view
206 x 2 template
template
master-fullstack-with-lambda-warmers....
master-fullstack.yaml
591:812 (5%)
101:322 (6%)
view
198 x 2 template
template
master-fullstack-with-lambda-warmers....
master-fullstack.yaml
3199:3396 (5%)
2730:2927 (6%)
view
114 x 2 template
template
master-fullstack-with-lambda-warmers....
master-fullstack.yaml
3019:3132 (3%)
2551:2664 (3%)
view
82 x 2 template
template
master-fullstack-with-lambda-warmers....
master-fullstack.yaml
813:901 (2%)
325:413 (2%)
view
40 x 2 template
template
master-fullstack-with-lambda-warmers....
master-fullstack.yaml
3134:3173 (1%)
2665:2704 (1%)
view
40 x 2 template
template
master-fullstack-with-lambda-warmers....
master-fullstack.yaml
539:582 (1%)
57:100 (1%)
view
32 x 2 template
template
master-fullstack-with-lambda-warmers....
master-fullstack.yaml
903:934 (<1%)
417:448 (1%)
view
32 x 2 functions/APIs
functions/APIs
listItemsInCart.js
listOrders.js
1:53 (100%)
1:52 (100%)
view
27 x 2 template
template
master-fullstack-with-lambda-warmers....
master-fullstack-with-lambda-warmers....
2323:2349 (<1%)
2473:2499 (<1%)
view
27 x 2 template
template
master-fullstack-with-lambda-warmers....
master-fullstack-with-lambda-warmers....
2323:2349 (<1%)
2536:2562 (<1%)
view
27 x 2 template
template
master-fullstack-with-lambda-warmers....
master-fullstack-with-lambda-warmers....
2168:2194 (<1%)
2323:2349 (<1%)
view
27 x 2 template
template
master-fullstack-with-lambda-warmers....
master-fullstack-with-lambda-warmers....
2233:2259 (<1%)
2536:2562 (<1%)
view
27 x 2 template
template
master-fullstack.yaml
master-fullstack.yaml
1856:1882 (<1%)
2006:2032 (<1%)
view
27 x 2 template
template
master-fullstack-with-lambda-warmers....
master-fullstack-with-lambda-warmers....
2233:2259 (<1%)
2473:2499 (<1%)
view
27 x 2 template
template
master-fullstack-with-lambda-warmers....
master-fullstack-with-lambda-warmers....
2168:2194 (<1%)
2233:2259 (<1%)
view
27 x 2 template
template
master-fullstack-with-lambda-warmers....
master-fullstack-with-lambda-warmers....
2233:2259 (<1%)
2323:2349 (<1%)
view
27 x 2 template
template
master-fullstack.yaml
master-fullstack.yaml
1766:1792 (<1%)
2069:2095 (<1%)
view
Duplicated Units
The list of top 3 duplicated units.
See data for all 3 unit duplicates...
Size#FoldersFilesLinesCode
8 x 2 assets/src/modules/category
assets/src/modules/category
CategoryGallery.tsx
CategoryGalleryTeaser.tsx
26:35 
25:34 
view
7 x 2 assets/src/modules/pastPurchases
assets/src/modules/cart
PurchasedProductRow.tsx
CartProductRow.tsx
27:34 
35:42 
view
6 x 4 assets/src/modules/bestSellers
assets/src/modules/category
assets/src/modules/category
assets/src/modules/search
BestSellers.tsx
CategoryGallery.tsx
CategoryGalleryTeaser.tsx
SearchGallery.tsx
16:23 
17:24 
16:23 
17:24 
view