awslabs / document-understanding-solution
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
  • 14% duplication:
    • 12,969 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 1,909 duplicated lines
  • 217 duplicates
system14% (1,909 lines)
Duplication per Extension
js10% (604 lines)
scss18% (603 lines)
py17% (458 lines)
ts18% (244 lines)
Duplication per Component (primary)
source/app/components16% (835 lines)
source/lib18% (244 lines)
source/lambda/textractor26% (183 lines)
source/app/pages7% (152 lines)
deployment/document-understanding-cicd25% (100 lines)
source/lambda/helper12% (82 lines)
source/app/store9% (60 lines)
source/lambda/apiprocessor9% (59 lines)
source/lambda/syncprocessor44% (54 lines)
source/lambda/jobresultprocessor35% (46 lines)
source/lambda/asyncprocessor48% (34 lines)
source/app/styles4% (24 lines)
source/app/constants20% (18 lines)
source/app/utils3% (12 lines)
source11% (6 lines)
source/lambda/customResourceKendraIndex0% (0 lines)
source/lambda/documentprocessor0% (0 lines)
source/lambda/customResourceKendraDataSource0% (0 lines)
source/lambda/kendraIndexPoller0% (0 lines)
source/lambda/joberrorhandler0% (0 lines)
source/lambda/documentbulkprocessor0% (0 lines)
deployment/logger0% (0 lines)
deployment/custom-deployment0% (0 lines)

Duplication Between Components (50+ lines)

G source/lambda/jobresultprocessor source/lambda/jobresultprocessor source/lambda/syncprocessor source/lambda/syncprocessor source/lambda/jobresultprocessor--source/lambda/syncprocessor 68

Download: SVG DOT (open online Graphviz editor)

Open 3D force graph...

Show more details on duplication between components...
Longest Duplicates
The list of 20 longest duplicates.
See data for all 217 duplicates...
Size#FoldersFilesLinesCode
69 x 2 source/app/components/DocumentPreview
source/app/components/EntitiesCheckbox
DocumentPreview.scss
EntitiesCheckbox.scss
1:84 (100%)
1:84 (100%)
view
42 x 2 source/app/components/DocumentPreview
source/app/components/TableResults
DocumentPreview.scss
TableResults.scss
5:54 (60%)
5:54 (80%)
view
42 x 2 source/app/components/EntitiesCheckbox
source/app/components/TableResults
EntitiesCheckbox.scss
TableResults.scss
5:54 (60%)
5:54 (80%)
view
34 x 2 deployment/document-understanding-cicd
deployment/document-understanding-cicd
index.js
index.js
294:331 (8%)
361:398 (8%)
view
28 x 2 source/app/components/DocumentSearchBar
source/app/components/SearchBar
DocumentSearchBar.scss
SearchBar.scss
1:34 (100%)
1:34 (41%)
view
22 x 2 source/lambda/textractor/python
source/lambda/textractor/python
trp.py
trp.py
208:236 (4%)
260:288 (4%)
view
19 x 2 source/app/components/KendraFAQs
source/app/components/KendraTopResults
KendraFAQs.scss
KendraTopResults.scss
11:32 (70%)
11:32 (35%)
view
18 x 2 source/app/components/DocumentPreview
source/app/components/KeyValueList
DocumentPreview.scss
KeyValueList.scss
33:54 (26%)
37:58 (26%)
view
18 x 2 source/app/components/EntitiesCheckbox
source/app/components/KeyValueList
EntitiesCheckbox.scss
KeyValueList.scss
33:54 (26%)
37:58 (26%)
view
18 x 2 source/app/components/KeyValueList
source/app/components/TableResults
KeyValueList.scss
TableResults.scss
37:58 (26%)
33:54 (34%)
view
17 x 2 source/app/components/EntitiesCheckbox
source/app/components/KeyValueList
EntitiesCheckbox.scss
KeyValueList.scss
5:23 (24%)
5:23 (24%)
view
17 x 2 source/app/components/RawTextLines
source/app/components/TableResults
RawTextLines.scss
TableResults.scss
5:23 (29%)
5:23 (32%)
view
17 x 2 source/app/components/EntitiesCheckbox
source/app/components/RawTextLines
EntitiesCheckbox.scss
RawTextLines.scss
5:23 (24%)
5:23 (29%)
view
17 x 2 source/app/components/DocumentPreview
source/app/components/KeyValueList
DocumentPreview.scss
KeyValueList.scss
5:23 (24%)
5:23 (24%)
view
17 x 2 source/app/components/KeyValueList
source/app/components/TableResults
KeyValueList.scss
TableResults.scss
5:23 (24%)
5:23 (32%)
view
17 x 2 source/app/components/KeyValueList
source/app/components/RawTextLines
KeyValueList.scss
RawTextLines.scss
5:23 (24%)
5:23 (29%)
view
17 x 2 source/app/components/DocumentSearchBar
source/app/components/SearchBar
DocumentSearchBar.js
SearchBar.js
79:95 (24%)
114:130 (15%)
view
17 x 2 source/app/components/DocumentPreview
source/app/components/RawTextLines
DocumentPreview.scss
RawTextLines.scss
5:23 (24%)
5:23 (29%)
view
15 x 2 source/app/components/DocumentPreview
source/app/components/KeyValueList
DocumentPreview.scss
KeyValueList.scss
68:84 (21%)
68:85 (21%)
view
15 x 2 source/app/components/KeyValueList
source/app/components/RawTextLines
KeyValueList.scss
RawTextLines.scss
68:85 (21%)
53:70 (26%)
view
Duplicated Units
The list of top 2 duplicated units.
See data for all 2 unit duplicates...
Size#FoldersFilesLinesCode
8 x 2 deployment/document-understanding-cicd
deployment/document-understanding-cicd
index.js
index.js
298:307 
365:374 
view
6 x 2 deployment/document-understanding-cicd
deployment/document-understanding-cicd
index.js
index.js
311:317 
378:384 
view