aws-samples / aws-ekyc-sample
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:
    • 5,447 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 937 duplicated lines
  • 82 duplicates
system17% (937 lines)
Duplication per Extension
cs17% (506 lines)
tsx22% (307 lines)
ts8% (92 lines)
html50% (32 lines)
Duplication per Component (primary)
packages/ekyc-api/src16% (436 lines)
packages/ui/src21% (307 lines)
infra/resources9% (92 lines)
packages/lambdas/CheckRekognitionProject42% (50 lines)
packages/lambdas/GroundTruthJobHandler22% (20 lines)
infra/resources/ground-truth-template61% (16 lines)
infra57% (16 lines)
infra/lib0% (0 lines)
infra/utils/Permissions0% (0 lines)
packages/PostDeploymentScripts/src0% (0 lines)
packages/ui/public0% (0 lines)
packages/Base64Encoder0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 82 duplicates...
Size#FoldersFilesLinesCode
20 x 2 packages/ekyc-api/src/ekyc-api/DataDefinitions
packages/lambdas/GroundT...c/GroundTruthJobHandler
TrainingJob.cs
TrainingJob.cs
7:38 (100%)
7:38 (100%)
view
20 x 2 packages/ekyc-api/src/ekyc-api/DataDefinitions
packages/lambdas/CheckRe...CheckRekognitionProject
TrainingJob.cs
TrainingJob.cs
7:38 (100%)
7:39 (100%)
view
20 x 2 packages/lambdas/CheckRe...CheckRekognitionProject
packages/lambdas/GroundT...c/GroundTruthJobHandler
TrainingJob.cs
TrainingJob.cs
7:39 (100%)
7:38 (100%)
view
17 x 2 packages/ui/src/components/DocumentImageTaker
packages/ui/src/components/FieldData
index.tsx
index.tsx
262:279 (8%)
254:271 (8%)
view
16 x 2 packages/ekyc-api/src/ekyc-api/Controllers
packages/ekyc-api/src/ekyc-api/Controllers
SessionController.cs
SessionController.cs
164:189 (7%)
322:348 (7%)
view
14 x 2 packages/ekyc-api/src/ek...mentDefinitions/MY-NRIC
packages/ekyc-api/src/ek...mentDefinitions/MY-NRIC
MYKad_RekognitionFieldValueExtractor.cs
MYKad_TextractFieldValueExtractor.cs
297:317 (7%)
306:326 (7%)
view
13 x 2 packages/ekyc-api/src/ekyc-api/Controllers
packages/ekyc-api/src/ekyc-api/Controllers
SessionController.cs
SessionController.cs
322:342 (5%)
383:403 (5%)
view
13 x 2 packages/ekyc-api/src/ekyc-api/Controllers
packages/ekyc-api/src/ekyc-api/Controllers
SessionController.cs
SessionController.cs
164:184 (5%)
383:403 (5%)
view
12 x 2 infra/resources
infra/resources
storage.ts
storage.ts
65:77 (9%)
88:100 (9%)
view
11 x 2 packages/ui/src/components/DocumentImageTaker
packages/ui/src/components/FieldData
index.tsx
index.tsx
53:71 (5%)
58:76 (5%)
view
11 x 2 packages/ekyc-api/src/ekyc-api/Controllers
packages/ekyc-api/src/ekyc-api/Controllers
SessionController.cs
SessionController.cs
281:303 (4%)
407:427 (4%)
view
11 x 2 packages/ui/src/components/DocumentImageTaker
packages/ui/src/components/FieldData
index.tsx
index.tsx
172:183 (5%)
195:207 (5%)
view
10 x 2 packages/ui/src/components/TrainingJobs
packages/ui/src/componen...ificationRequestHistory
index.tsx
index.tsx
95:104 (13%)
91:100 (14%)
view
10 x 2 packages/ui/src/components/NosePointTaker
packages/ui/src/components/SelfieTaker
index.tsx
index.tsx
118:128 (7%)
107:117 (7%)
view
10 x 2 packages/ui/src/components/EyesCloseTaker
packages/ui/src/components/NosePointTaker
index.tsx
index.tsx
72:82 (9%)
118:128 (7%)
view
10 x 2 packages/ui/src/components/EyesCloseTaker
packages/ui/src/components/NosePointTaker
index.tsx
index.tsx
91:107 (9%)
138:155 (7%)
view
10 x 2 packages/ui/src/components/NosePointTaker
packages/ui/src/components/SelfieTaker
index.tsx
index.tsx
181:191 (7%)
161:170 (7%)
view
10 x 2 packages/ui/src/components/EyesCloseTaker
packages/ui/src/components/SelfieTaker
index.tsx
index.tsx
72:82 (9%)
107:117 (7%)
view
10 x 2 packages/ui/src/components/DocumentImageTaker
packages/ui/src/components/FieldData
index.tsx
index.tsx
94:106 (4%)
113:125 (4%)
view
9 x 2 infra/resources/ground-truth-template
infra
labellers.html
workertemplate.html
1:10 (34%)
1:10 (42%)
view
Duplicated Units
The list of top 3 duplicated units.
See data for all 3 unit duplicates...
Size#FoldersFilesLinesCode
8 x 2 packages/ekyc-api/src/ek...efinitions/PRC_PASSPORT
packages/ekyc-api/src/ek...Definitions/SG_PASSPORT
PRC_Passport_DocumentDefinition.cs
SG_Passport_DocumentDefinition.cs
21:29 
19:27 
view
6 x 3 packages/ekyc-api/src/ek...efinitions/PRC_PASSPORT
packages/ekyc-api/src/ek...mentDefinitions/MY-NRIC
packages/ekyc-api/src/ek...cumentDefinitions/KH-ID
PRC_Passport_TextractFieldValueExtrac...
MYKad_TextractFieldValueExtractor.cs
KH_IC_TextractFieldValueExtractor.cs
23:29 
35:41 
25:31 
view
6 x 2 packages/ekyc-api/src/ekyc-api/Utils
packages/ekyc-api/src/ekyc-api/Utils
DataRequestManager.cs
SessionManager.cs
19:25 
21:27 
view