awslabs / data-transfer-hub
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
  • 21% duplication:
    • 9,785 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 2,070 duplicated lines
  • 193 duplicates
system21% (2,070 lines)
Duplication per Extension
tsx26% (1,500 lines)
ts14% (302 lines)
js28% (149 lines)
scss9% (119 lines)
Duplication per Component (primary)
source/portal/src/pages27% (1,507 lines)
source/portal/src/common12% (154 lines)
source/custom-resource66% (149 lines)
source/portal/src14% (100 lines)
source/portal/src/graphql78% (89 lines)
source/constructs/lib5% (53 lines)
source/constructs/lambda/api8% (12 lines)
source/portal/src/assets5% (6 lines)
source/constructs0% (0 lines)
source/constructs/lambda/cdk0% (0 lines)
source/constructs/lambda0% (0 lines)
source/constructs/lambda/custom-resource0% (0 lines)
source/custom-resource/lib0% (0 lines)
source/custom-resource/lib/usage-metrics0% (0 lines)
source/portal/src/store0% (0 lines)
source/portal/public0% (0 lines)
source/schema0% (0 lines)
deployment/cdk-solution-helper0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 193 duplicates...
Size#FoldersFilesLinesCode
83 x 2 source/portal/src/pages/detail
source/portal/src/pages/detail
DetailECR.tsx
DetailS3.tsx
188:272 (23%)
268:352 (13%)
view
54 x 2 source/portal/src/pages/detail
source/portal/src/pages/detail
DetailECR.tsx
DetailS3.tsx
46:107 (15%)
63:124 (8%)
view
41 x 2 source/portal/src/pages/creation/ecr
source/portal/src/pages/creation/s3
StepThreeECR.tsx
StepThreeS3.tsx
241:282 (14%)
395:436 (9%)
view
35 x 2 source/portal/src/pages/creation/ecr
source/portal/src/pages/creation/s3
StepThreeECR.tsx
StepThreeS3.tsx
326:361 (12%)
492:527 (8%)
view
24 x 2 source/portal/src
source/portal/src
API.ts
API.ts
79:102 (13%)
110:133 (13%)
view
24 x 2 source/portal/src
source/portal/src
API.ts
API.ts
79:102 (13%)
177:200 (13%)
view
24 x 2 source/portal/src
source/portal/src
API.ts
API.ts
110:133 (13%)
177:200 (13%)
view
23 x 2 source/portal/src/pages/detail
source/portal/src/pages/list
DetailS3.tsx
TaskList.tsx
284:306 (3%)
641:663 (3%)
view
23 x 2 source/portal/src/pages/creation/s3/comps
source/portal/src/pages/creation/s3/comps
EC2Config.tsx
LambdaConfig.tsx
91:113 (10%)
78:100 (17%)
view
23 x 2 source/portal/src/pages/detail
source/portal/src/pages/list
DetailECR.tsx
TaskList.tsx
204:226 (6%)
641:663 (3%)
view
22 x 2 source/portal/src
source/portal/src
API.ts
API.ts
79:100 (12%)
144:165 (12%)
view
22 x 2 source/portal/src/common
source/portal/src/common
InfoBar.scss
LeftMenu.scss
14:35 (47%)
20:42 (40%)
view
22 x 2 source/portal/src
source/portal/src
API.ts
API.ts
144:165 (12%)
177:198 (12%)
view
22 x 2 source/portal/src
source/portal/src
API.ts
API.ts
110:131 (12%)
144:165 (12%)
view
21 x 2 source/portal/src/pages/creation
source/portal/src/pages/creation/s3
StepOne.tsx
StepThreeS3.tsx
108:128 (14%)
397:417 (4%)
view
21 x 2 source/portal/src/pages/creation
source/portal/src/pages/creation/ecr
StepOne.tsx
StepThreeECR.tsx
108:128 (14%)
243:263 (7%)
view
20 x 2 source/portal/src/pages/creation/ecr
source/portal/src/pages/creation/s3
StepThreeECR.tsx
StepThreeS3.tsx
190:214 (6%)
361:386 (4%)
view
20 x 2 source/portal/src/pages/creation/s3/comps
source/portal/src/pages/creation/s3/comps
DestSettings.tsx
EC2Config.tsx
307:326 (6%)
173:192 (8%)
view
20 x 2 source/portal/src/pages/creation/ecr
source/portal/src/pages/creation/s3
StepTwoECR.tsx
StepTwoS3.tsx
348:367 (3%)
218:237 (10%)
view
18 x 2 source/portal/src/graphql
source/portal/src/graphql
queries.ts
subscriptions.ts
36:57 (36%)
8:29 (85%)
view
Duplicated Units
The list of top 3 duplicated units.
See data for all 3 unit duplicates...
Size#FoldersFilesLinesCode
20 x 2 source/portal/src/graphql
source/portal/src/graphql
queries.ts
mutations.ts
35:55 
7:27 
view
15 x 2 source/portal/src/pages/detail
source/portal/src/pages/detail
DetailS3.tsx
DetailECR.tsx
105:125 
88:108 
view
9 x 2 source/custom-resource
source/custom-resource
index.js
index.js
45:55 
219:229 
view