aws-samples / smart-cooler
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
  • 26% duplication:
    • 2,982 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 777 duplicated lines
  • 41 duplicates
system26% (777 lines)
Duplication per Extension
yml30% (314 lines)
js88% (286 lines)
py9% (144 lines)
yaml18% (33 lines)
Duplication per Component (primary)
ROOT30% (308 lines)
SmartCoolerCharge83% (150 lines)
SmartCoolerScan85% (150 lines)
authentication-function45% (49 lines)
purchase-function14% (49 lines)
qr-monitoring-function34% (23 lines)
qr-reader-function20% (23 lines)
update-product-local-function32% (19 lines)
detection-function<1% (6 lines)
door-sensor-function0% (0 lines)
update-product-function0% (0 lines)

Duplication Between Components (50+ lines)

G SmartCoolerCharge SmartCoolerCharge SmartCoolerScan SmartCoolerScan SmartCoolerCharge--SmartCoolerScan 300 authentication-function authentication-function purchase-function purchase-function authentication-function--purchase-function 98

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 41 duplicates...
Size#FoldersFilesLinesCode
95 x 2 SmartCoolerCharge
SmartCoolerScan
clientHelper.js
clientHelper.js
1:148 (100%)
1:148 (100%)
view
43 x 2 ROOT
ROOT
smart-cooler-api.yml
smart-cooler-od.yml
139:182 (25%)
144:188 (20%)
view
29 x 2 ROOT
ROOT
smart-cooler-api.yml
template.yml
140:168 (17%)
596:624 (4%)
view
29 x 2 ROOT
ROOT
smart-cooler-od.yml
template.yml
145:173 (13%)
596:624 (4%)
view
23 x 2 qr-monitoring-function/src
qr-reader-function/src
localstorage.py
localstorage.py
5:31 (100%)
5:31 (100%)
view
23 x 2 authentication-function/src
purchase-function/src
localstorage.py
localstorage.py
5:31 (100%)
5:31 (100%)
view
23 x 2 purchase-function/src
qr-monitoring-function/src
localstorage.py
localstorage.py
5:31 (100%)
5:31 (100%)
view
23 x 2 authentication-function/src
qr-reader-function/src
localstorage.py
localstorage.py
5:31 (100%)
5:31 (100%)
view
23 x 2 purchase-function/src
qr-reader-function/src
localstorage.py
localstorage.py
5:31 (100%)
5:31 (100%)
view
23 x 2 authentication-function/src
qr-monitoring-function/src
localstorage.py
localstorage.py
5:31 (100%)
5:31 (100%)
view
15 x 2 SmartCoolerCharge
SmartCoolerScan
index.js
index.js
46:63 (28%)
34:51 (36%)
view
13 x 2 SmartCoolerCharge
SmartCoolerScan
client.js
client.js
1:26 (100%)
1:26 (100%)
view
13 x 2 ROOT
update-product-local-function
template.yml
template.yaml
532:544 (2%)
30:42 (35%)
view
12 x 2 SmartCoolerCharge
SmartCoolerScan
index.js
index.js
13:39 (23%)
9:27 (29%)
view
11 x 2 ROOT
ROOT
smart-cooler-od.yml
template.yml
176:188 (5%)
628:638 (1%)
view
11 x 2 ROOT
ROOT
smart-cooler-api.yml
template.yml
171:182 (6%)
628:638 (1%)
view
10 x 2 ROOT
ROOT
smart-cooler-api.yml
smart-cooler-api.yml
43:52 (5%)
69:78 (5%)
view
10 x 2 ROOT
ROOT
template.yml
template.yml
304:313 (1%)
337:346 (1%)
view
9 x 2 ROOT
ROOT
smart-cooler-od.yml
smart-cooler-od.yml
27:35 (4%)
176:184 (4%)
view
9 x 2 ROOT
ROOT
smart-cooler-od.yml
template.yml
27:35 (4%)
628:636 (1%)
view
Duplicated Units
The list of top 11 duplicated units.
See data for all 11 unit duplicates...
Size#FoldersFilesLinesCode
32 x 2 SmartCoolerCharge
SmartCoolerScan
clientHelper.js
clientHelper.js
15:61 
15:61 
view
18 x 2 SmartCoolerCharge
SmartCoolerScan
clientHelper.js
clientHelper.js
77:97 
77:97 
view
17 x 2 SmartCoolerCharge
SmartCoolerScan
index.js
index.js
41:59 
29:47 
view
13 x 2 SmartCoolerCharge
SmartCoolerScan
clientHelper.js
clientHelper.js
133:149 
133:149 
view
11 x 2 SmartCoolerCharge
SmartCoolerScan
clientHelper.js
clientHelper.js
117:131 
117:131 
view
8 x 2 SmartCoolerCharge
SmartCoolerScan
clientHelper.js
clientHelper.js
104:112 
104:112 
view
7 x 4 qr-monitoring-function/src
authentication-function/src
purchase-function/src
qr-reader-function/src
localstorage.py
localstorage.py
localstorage.py
localstorage.py
0:0 
0:0 
0:0 
0:0 
view
7 x 2 SmartCoolerCharge
SmartCoolerScan
clientHelper.js
clientHelper.js
68:75 
68:75 
view
6 x 4 qr-monitoring-function/src
authentication-function/src
purchase-function/src
qr-reader-function/src
localstorage.py
localstorage.py
localstorage.py
localstorage.py
0:0 
0:0 
0:0 
0:0 
view
15 x 2 SmartCoolerCharge
SmartCoolerScan
clientHelper.js
clientHelper.js
99:115 
99:115 
view
10 x 2 SmartCoolerCharge
SmartCoolerScan
clientHelper.js
clientHelper.js
103:113 
103:113 
view