aws-samples / aws-iot-core-acmebots-monitoring
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
  • 23% duplication:
    • 4,436 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 1,024 duplicated lines
  • 91 duplicates
system23% (1,024 lines)
Duplication per Extension
js30% (934 lines)
yml6% (90 lines)
Duplication per Component (primary)
backend/src37% (530 lines)
bots/scripts76% (248 lines)
frontend/src10% (96 lines)
backend7% (90 lines)
frontend/scripts66% (60 lines)
ROOT0% (0 lines)
bots0% (0 lines)
bots/src0% (0 lines)
bots/example0% (0 lines)
frontend/public0% (0 lines)
backend/config0% (0 lines)

Duplication Between Components (50+ lines)

G backend/src backend/src bots/scripts bots/scripts backend/src--bots/scripts 236 frontend/scripts frontend/scripts bots/scripts--frontend/scripts 176

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 91 duplicates...
Size#FoldersFilesLinesCode
42 x 2 bots/scripts
frontend/scripts
setup.js
setup.js
11:65 (70%)
17:71 (63%)
view
39 x 2 backend/src/cleanup
backend/src/cleanup
clear-ecs-cluster.js
clear-s3-bucket.js
165:212 (23%)
75:122 (41%)
view
37 x 2 backend/src/cleanup
backend/src/cleanup
clear-ecr-repo.js
detachPrincipals.js
52:99 (46%)
49:96 (47%)
view
37 x 2 backend/src/cleanup
bots/scripts
clear-ecs-cluster.js
clear-ecs-cluster.js
124:168 (22%)
132:176 (22%)
view
35 x 2 backend/src/cleanup
backend/src/cleanup
clear-ecr-repo.js
clear-ecs-cluster.js
58:99 (44%)
171:212 (21%)
view
35 x 2 backend/src/cleanup
backend/src/cleanup
clear-s3-bucket.js
detachPrincipals.js
81:122 (36%)
55:96 (44%)
view
35 x 2 backend/src/cleanup
backend/src/cleanup
clear-ecs-cluster.js
detachPrincipals.js
171:212 (21%)
55:96 (44%)
view
35 x 2 backend/src/cleanup
backend/src/cleanup
clear-ecr-repo.js
clear-s3-bucket.js
58:99 (44%)
81:122 (36%)
view
34 x 2 bots/scripts
bots/scripts
env-setup.js
setup.js
40:82 (65%)
37:79 (56%)
view
24 x 2 bots/scripts
frontend/scripts
env-setup.js
setup.js
40:68 (46%)
43:71 (36%)
view
19 x 2 bots/scripts
frontend/scripts
clear-ecs-cluster.js
setup.js
201:226 (11%)
25:50 (28%)
view
19 x 2 bots/scripts
bots/scripts
clear-ecs-cluster.js
setup.js
201:226 (11%)
19:44 (31%)
view
19 x 2 backend/src/cwEvents
backend/src/cwEvents
processAcmeBotsConnectivityEvents.js
processAcmeBotsStatusEvents.js
48:72 (32%)
48:72 (32%)
view
19 x 2 frontend/src/components
frontend/src/components
Telemetry.js
Things.js
21:42 (4%)
8:29 (6%)
view
18 x 2 backend/src/cleanup
bots/scripts
clear-ecs-cluster.js
clear-ecs-cluster.js
24:45 (10%)
38:59 (10%)
view
17 x 2 backend/src/cleanup
bots/scripts
clear-ecs-cluster.js
clear-ecs-cluster.js
61:82 (10%)
78:99 (10%)
view
13 x 2 bots/scripts
bots/scripts
clear-ecr-repo.js
clear-ecs-cluster.js
45:62 (28%)
202:219 (7%)
view
13 x 2 backend/src/bot
bots/scripts
ecsDeleteBot.js
clear-ecs-cluster.js
25:39 (15%)
51:65 (7%)
view
13 x 2 bots/scripts
bots/scripts
clear-ecr-repo.js
setup.js
45:62 (28%)
20:37 (21%)
view
13 x 2 bots/scripts
frontend/scripts
clear-ecr-repo.js
setup.js
45:62 (28%)
26:43 (19%)
view
Duplicated Units
The list of top 11 duplicated units.
See data for all 11 unit duplicates...
Size#FoldersFilesLinesCode
36 x 4 backend/src/cleanup
backend/src/cleanup
backend/src/cleanup
backend/src/cleanup
clear-ecr-repo.js
detachPrincipals.js
clear-s3-bucket.js
clear-ecs-cluster.js
58:100 
55:97 
81:123 
171:213 
view
29 x 2 bots/scripts
bots/scripts
setup.js
env-setup.js
47:77 
50:80 
view
22 x 2 frontend/src/components
frontend/src/components
Things.js
Telemetry.js
8:30 
21:43 
view
12 x 2 backend/src/step-functions
backend/src/step-functions
provisionThing.js
removeThing.js
11:23 
11:23 
view
9 x 4 bots/scripts
bots/scripts
bots/scripts
frontend/scripts
clear-ecr-repo.js
setup.js
clear-ecs-cluster.js
setup.js
54:63 
29:38 
211:220 
35:44 
view
8 x 4 bots/scripts
bots/scripts
bots/scripts
frontend/scripts
clear-ecr-repo.js
setup.js
clear-ecs-cluster.js
setup.js
44:52 
19:27 
201:209 
25:33 
view
8 x 3 bots/scripts
backend/src/bot
backend/src/cleanup
clear-ecs-cluster.js
ecsDeleteBot.js
clear-ecs-cluster.js
141:149 
86:94 
133:141 
view
8 x 3 bots/scripts
backend/src/bot
backend/src/cleanup
clear-ecs-cluster.js
ecsDeleteBot.js
clear-ecs-cluster.js
169:177 
105:113 
161:169 
view
7 x 2 bots/scripts
backend/src/cleanup
clear-ecs-cluster.js
clear-ecs-cluster.js
132:139 
124:131 
view
7 x 2 bots/scripts
backend/src/cleanup
clear-ecs-cluster.js
clear-ecs-cluster.js
151:158 
143:150 
view
7 x 2 bots/scripts
backend/src/cleanup
clear-ecs-cluster.js
clear-ecs-cluster.js
160:167 
152:159 
view