aws-solutions / aws-qnabot
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
  • 25% duplication:
    • 22,358 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 5,694 duplicated lines
  • 1,069 duplicates
system25% (5,694 lines)
Duplication per Extension
js25% (4,206 lines)
vue22% (875 lines)
py23% (276 lines)
scss99% (182 lines)
css32% (80 lines)
html48% (63 lines)
yaml4% (12 lines)
Duplication per Component (primary)
templates/master35% (2,014 lines)
website/js20% (875 lines)
templates/export45% (530 lines)
templates41% (243 lines)
lambda/es-proxy-layer10% (232 lines)
lambda/export38% (196 lines)
templates/dev41% (185 lines)
lambda/cfn14% (173 lines)
lambda/testall68% (158 lines)
lambda/fulfillment7% (133 lines)
templates/import53% (132 lines)
templates/public-vpc-support84% (108 lines)
templates/public87% (105 lines)
lambda/kendra-webcrawler68% (94 lines)
lambda/lex-build21% (83 lines)
lambda/kendra-webcrawler-schedule-updater71% (80 lines)
templates/testall40% (66 lines)
lambda/schema14% (54 lines)
utility_scripts13% (54 lines)
lambda/lexv2-build6% (36 lines)
website/config16% (35 lines)
lambda/genesys9% (33 lines)
lambda/connect42% (21 lines)
lambda/qnabot-common-layer11% (19 lines)
lambda/kendra-webcrawler-status33% (18 lines)
templates/lib24% (9 lines)
lambda/import5% (8 lines)
website0% (0 lines)
website/style0% (0 lines)
website/html0% (0 lines)
utility_scripts/csv2json_converter0% (0 lines)
lambda/proxy-es0% (0 lines)
lambda/js_lambda_hook_sdk0% (0 lines)
lambda/translate0% (0 lines)
lambda0% (0 lines)

Duplication Between Components (50+ lines)

G templates/import templates/import templates/master templates/master templates/import--templates/master 404 templates/testall templates/testall templates/import--templates/testall 144 templates/master--templates/testall 353 templates templates templates/master--templates 196 lambda/export lambda/export lambda/testall lambda/testall lambda/export--lambda/testall 323 templates/dev templates/dev templates/dev--templates/import 55 templates/dev--templates/master 320 templates/dev--templates/testall 55 templates/export templates/export templates/dev--templates/export 75 templates/export--templates/import 118 templates/export--templates/master 257 templates/export--templates/testall 86 templates/public-vpc-support templates/public-vpc-support templates/public templates/public templates/public-vpc-support--templates/public 213 lambda/kendra-webcrawler-schedule-updater lambda/kendra-webcrawler-schedule-updater lambda/kendra-webcrawler lambda/kendra-webcrawler lambda/kendra-webcrawler-schedule-updater--lambda/kendra-webcrawler 166 lambda/es-proxy-layer lambda/es-proxy-layer lambda/es-proxy-layer--lambda/export 62 lambda/lex-build lambda/lex-build lambda/es-proxy-layer--lambda/lex-build 88 lambda/fulfillment lambda/fulfillment lambda/es-proxy-layer--lambda/fulfillment 50

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 1,069 duplicates...
Size#FoldersFilesLinesCode
80 x 2 templates/master/cognito/style
templates/master/cognito/style
client.scss
designer.scss
1:80 (87%)
1:80 (86%)
view
75 x 2 website/js/components/connect
website/js/components/genesys
index.vue
index.vue
8:91 (33%)
8:91 (48%)
view
56 x 2 website/js/components/alexa
website/js/components/connect
index.vue
index.vue
8:67 (45%)
8:69 (24%)
view
56 x 2 website/js/components/alexa
website/js/components/genesys
index.vue
index.vue
8:67 (45%)
8:69 (36%)
view
45 x 2 templates/dev/bootstrap
templates/dev
index.js
bucket.js
51:101 (36%)
53:104 (47%)
view
42 x 2 templates
templates
util.js
util.js
273:318 (7%)
322:367 (7%)
view
42 x 2 website/js/components/connect
website/js/components/genesys
index.vue
index.vue
102:146 (18%)
92:135 (27%)
view
36 x 2 templates/master/signup
templates/master/signup
index.js
index.js
28:65 (29%)
71:107 (29%)
view
33 x 2 templates/public-vpc-support
templates/public
index.js
index.js
68:105 (25%)
57:94 (27%)
view
31 x 2 templates/export
templates/export
resources.js
resources.js
41:75 (2%)
113:147 (2%)
view
31 x 2 templates/master/routes
templates/master/routes
images.js
proxy.js
44:76 (44%)
55:87 (39%)
view
30 x 2 lambda/export/lib
lambda/testall/lib
start.js
start.js
1:34 (100%)
1:34 (100%)
view
30 x 2 lambda/es-proxy-layer/lib
lambda/lex-build/lib
utterances.js
utterances.js
35:67 (46%)
14:46 (71%)
view
30 x 2 templates/master
templates/master
bucket.js
bucket.js
14:48 (13%)
178:212 (13%)
view
30 x 2 website/js/components/alexa
website/js/components/connect
index.vue
index.vue
89:118 (24%)
95:124 (13%)
view
29 x 2 templates/master/lex
templates/master/lex
fulfillment.js
fulfillment.js
178:208 (7%)
329:359 (7%)
view
28 x 2 templates/export
templates/export
resources.js
resources.js
909:938 (2%)
1041:1070 (2%)
view
28 x 2 templates/public-vpc-support
templates/public
index.js
index.js
1:30 (21%)
1:30 (23%)
view
26 x 2 templates/public-vpc-support
templates/public
index.js
index.js
112:143 (20%)
97:128 (21%)
view
26 x 2 lambda/kendra-webcrawler-schedule-updater
lambda/kendra-webcrawler
kendra_webcrawler_schedule_updater.py
kendra_webcrawler.py
26:58 (23%)
25:58 (18%)
view
Duplicated Units
The list of top 17 duplicated units.
See data for all 17 unit duplicates...
Size#FoldersFilesLinesCode
20 x 2 lambda/export/lib
lambda/testall/lib
clean.js
clean.js
9:29 
9:29 
view
20 x 2 lambda/fulfillment/lib/middleware
lambda/fulfillment/lib/middleware
lexRouter.js
specialtyBotRouter.js
37:60 
33:56 
view
16 x 2 lambda/es-proxy-layer/lib
lambda/es-proxy-layer/lib
kendra.js
kendraQuery.js
110:126 
38:54 
view
14 x 3 lambda/export
lambda/es-proxy-layer/lib
lambda/qnabot-common-layer/qnabot
kendraSync.js
handler.js
settings.js
31:45 
23:37 
6:20 
view
14 x 2 lambda/fulfillment/lib/middleware
lambda/fulfillment/lib/middleware
lexRouter.js
specialtyBotRouter.js
68:82 
102:116 
view
13 x 2 lambda/export
lambda/es-proxy-layer/lib
kendraSync.js
handler.js
53:67 
39:52 
view
13 x 2 lambda/es-proxy-layer/lib
lambda/export
handler.js
kendraSync.js
39:52 
53:67 
view
12 x 4 lambda/export/lib
lambda/export/lib
lambda/testall/lib
lambda/testall/lib
load.js
start.js
load.js
start.js
52:64 
25:37 
51:63 
25:37 
view
11 x 2 lambda/export/lib
lambda/testall/lib
step.js
step.js
12:23 
12:23 
view
11 x 2 lambda/export/lib
lambda/testall/lib
start.js
start.js
12:24 
12:24 
view
11 x 2 lambda/es-proxy-layer/lib
lambda/es-proxy-layer/lib
kendra.js
kendraQuery.js
22:33 
15:27 
view
11 x 2 lambda/es-proxy-layer/lib
lambda/lex-build/lib
utterances.js
utterances.js
44:55 
23:34 
view
9 x 2 templates/master/routes/qa
templates/master/routes/qa
test.js
test.js
14:23 
36:45 
view
8 x 3 lambda/kendra-webcrawler-status
lambda/kendra-webcrawler-schedule-updater
lambda/kendra-webcrawler
kendra_webcrawler_status.py
kendra_webcrawler_schedule_updater.py
kendra_webcrawler.py
0:0 
0:0 
0:0 
view
9 x 2 lambda/kendra-webcrawler-status
lambda/kendra-webcrawler
kendra_webcrawler_status.py
kendra_webcrawler.py
0:0 
0:0 
view
8 x 2 lambda/es-proxy-layer/lib
lambda/fulfillment/lib/middleware
translate.js
multilanguage.js
6:14 
16:24 
view
7 x 3 lambda/export
lambda/es-proxy-layer/lib
lambda/fulfillment/lib/middleware
kendraSync.js
handler.js
1_parse.js
22:29 
14:21 
12:19 
view