awslabs / photo-search-on-aws
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
  • 8% duplication:
    • 2,927 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 240 duplicated lines
  • 20 duplicates
system8% (240 lines)
Duplication per Extension
ts8% (143 lines)
tsx6% (70 lines)
scss26% (27 lines)
Duplication per Component (primary)
source/frontend/src/components8% (97 lines)
source/backend/lib14% (91 lines)
source/backend/lambda/photos9% (46 lines)
source/backend/lambda/names15% (6 lines)
source/frontend/src0% (0 lines)
source/frontend/src/utils0% (0 lines)
source/frontend/src/services0% (0 lines)
source/frontend/src/hooks0% (0 lines)
source/frontend/src/states0% (0 lines)
source/frontend/public0% (0 lines)
source/backend0% (0 lines)
source/backend/lambda/common0% (0 lines)
source/backend/lambda/custom-resources0% (0 lines)
source/backend/lambda0% (0 lines)
source/backend/lambda/batches0% (0 lines)
deployment/cdk-solution-helper0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 20 duplicates...
Size#FoldersFilesLinesCode
21 x 2 source/backend/lib
source/backend/lib
cdk-photosearch-backend-stack.ts
cdk-photosearch-web-stack.ts
495:518 (5%)
136:159 (16%)
view
15 x 2 source/backend/lib
source/backend/lib
cdk-photosearch-backend-stack.ts
cdk-photosearch-backend-stack.ts
448:465 (3%)
501:518 (3%)
view
15 x 2 source/backend/lib
source/backend/lib
cdk-photosearch-backend-stack.ts
cdk-photosearch-web-stack.ts
448:465 (3%)
142:159 (11%)
view
10 x 2 source/frontend/src/components/photo-card
source/frontend/src/components/photo-register-card
photo-card.scss
photo-register-card.scss
4:14 (83%)
6:16 (76%)
view
9 x 2 source/frontend/src/components/photo-card
source/frontend/src/components/photo-register-card
photo-card.tsx
photo-register-card.tsx
30:38 (45%)
37:45 (34%)
view
7 x 2 source/backend/lib
source/backend/lib
cdk-photosearch-backend-stack.ts
cdk-photosearch-backend-stack.ts
262:268 (1%)
303:309 (1%)
view
7 x 2 source/frontend/src/components/face-card
source/frontend/src/components/photo-card
face-card.scss
photo-card.scss
10:17 (50%)
7:14 (58%)
view
7 x 2 source/frontend/src/comp...hoto-search-photo-faces
source/frontend/src/comp...to-search-photo-results
photo-search-photo-faces.tsx
photo-search-photo-results.tsx
49:55 (7%)
43:49 (11%)
view
7 x 2 source/frontend/src/components/photo-register
source/frontend/src/components/photo-search-name
photo-register.tsx
photo-search-name.tsx
47:53 (5%)
41:47 (8%)
view
7 x 2 source/backend/lib
source/backend/lib
cdk-photosearch-backend-stack.ts
cdk-photosearch-web-stack.ts
65:73 (1%)
104:111 (5%)
view
7 x 2 source/frontend/src/components/face-card
source/frontend/src/components/photo-register-card
face-card.scss
photo-register-card.scss
10:17 (50%)
9:16 (53%)
view
7 x 2 source/backend/lambda/photos/delete-photo
source/backend/lambda/photos/get-similars
index.ts
index.ts
81:87 (9%)
144:150 (4%)
view
7 x 2 source/backend/lambda/photos/get-faces
source/backend/lambda/photos/get-similars
index.ts
index.ts
46:52 (10%)
48:54 (4%)
view
6 x 2 source/backend/lib
source/backend/lib
cdk-photosearch-backend-stack.ts
cdk-photosearch-backend-stack.ts
357:363 (1%)
501:507 (1%)
view
6 x 2 source/backend/lambda/names/resigiter-name
source/backend/lambda/photos/get-upload-urls
index.ts
index.ts
23:29 (15%)
29:41 (17%)
view
6 x 2 source/backend/lib
source/backend/lib
cdk-photosearch-backend-stack.ts
cdk-photosearch-backend-stack.ts
357:363 (1%)
448:454 (1%)
view
6 x 2 source/backend/lib
source/backend/lib
cdk-photosearch-backend-stack.ts
cdk-photosearch-web-stack.ts
357:363 (1%)
142:148 (4%)
view
6 x 2 source/frontend/src/components/photo-register
source/frontend/src/components/photo-search-name
photo-register.tsx
photo-search-name.tsx
55:60 (4%)
49:54 (7%)
view
6 x 2 source/frontend/src/components/photo-register
source/frontend/src/components/photo-search-name
photo-register.tsx
photo-search-name.tsx
67:72 (4%)
60:65 (7%)
view
6 x 2 source/backend/lambda/photos/delete-photo
source/backend/lambda/photos/get-similars
index.ts
index.ts
21:27 (8%)
24:30 (4%)
view