aws-samples / reinvent2021-tsa-bot
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
  • 66% duplication:
    • 1,908 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 1,267 duplicated lines
  • 20 duplicates
system66% (1,267 lines)
Duplication per Extension
py72% (1,267 lines)
Duplication per Component (primary)
TSA-demo/TSA_mecha82% (650 lines)
TSA-demo/TSA_voice_assistant79% (462 lines)
cloudformation-templates/cdk.out/asset.34e613cbed9fe6d92140a799a0714c454ff967fe816d79cb9e5cef24fdb8ad22100% (59 lines)
cloudformation-templates/resources/Lambda/update-flight-LasVegasdeparture96% (57 lines)
TSA-demo/TSA_flight_status52% (39 lines)
cloudformation-templates/lib0% (0 lines)
cloudformation-templates0% (0 lines)
TSA-demo/TSA_rekognition0% (0 lines)

Duplication Between Components (50+ lines)

G cloudformation-templates/cdk.out/asset.34e613cbed9fe6d92140a799a0714c454ff967fe816d79cb9e5cef24fdb8ad22 cloudformation-templates/cdk.out/asset.34e613cbed9fe6d92140a799a0714c454ff967fe816d79cb9e5cef24fdb8ad22 cloudformation-templates/resources/Lambda/update-flight-LasVegasdeparture cloudformation-templates/resources/Lambda/update-flight-LasVegasdeparture cloudformation-templates/cdk.out/asset.34e613cbed9fe6d92140a799a0714c454ff967fe816d79cb9e5cef24fdb8ad22--cloudformation-templates/resources/Lambda/update-flight-LasVegasdeparture 114 TSA-demo/TSA_flight_status TSA-demo/TSA_flight_status TSA-demo/TSA_flight_status--cloudformation-templates/cdk.out/asset.34e613cbed9fe6d92140a799a0714c454ff967fe816d79cb9e5cef24fdb8ad22 66 TSA-demo/TSA_flight_status--cloudformation-templates/resources/Lambda/update-flight-LasVegasdeparture 62

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 20 duplicates...
Size#FoldersFilesLinesCode
114 x 2 TSA-demo/TSA_mecha
TSA-demo/TSA_mecha
finalflow-mqtt-dev-local.py
finalflow-mqtt-dev-rasp.py
223:346 (38%)
206:329 (39%)
view
90 x 2 TSA-demo/TSA_mecha
TSA-demo/TSA_mecha
finalflow-mqtt-dev-local.py
finalflow-mqtt-dev-rasp.py
109:213 (30%)
95:193 (30%)
view
90 x 2 TSA-demo/TSA_voice_assistant
TSA-demo/TSA_voice_assistant
raspberry_voice_assistant.py
raspberry_voice_assistant_local.py
33:152 (38%)
45:179 (37%)
view
87 x 2 TSA-demo/TSA_voice_assistant
TSA-demo/TSA_voice_assistant
raspberry_voice_assistant.py
raspberry_voice_assistant_local.py
154:263 (37%)
182:291 (36%)
view
57 x 2 cloudformation-templates...16d79cb9e5cef24fdb8ad22
cloudformation-templates...light-LasVegasdeparture
flight.py
flight.py
11:83 (96%)
11:83 (96%)
view
51 x 2 TSA-demo/TSA_voice_assistant
TSA-demo/TSA_voice_assistant
raspberry_voice_assistant.py
raspberry_voice_assistant_local.py
265:323 (21%)
293:351 (21%)
view
36 x 2 TSA-demo/TSA_mecha
TSA-demo/TSA_mecha
finalflow-mqtt-dev-local.py
finalflow-mqtt-dev-rasp.py
36:84 (12%)
33:81 (12%)
view
22 x 2 TSA-demo/TSA_flight_status
cloudformation-templates...16d79cb9e5cef24fdb8ad22
flight.py
flight.py
46:67 (29%)
31:52 (37%)
view
22 x 2 TSA-demo/TSA_flight_status
cloudformation-templates...light-LasVegasdeparture
flight.py
flight.py
46:67 (29%)
31:52 (37%)
view
22 x 2 TSA-demo/TSA_mecha
TSA-demo/TSA_mecha
finalflow-mqtt-dev-local.py
finalflow-mqtt-dev-rasp.py
349:487 (7%)
331:470 (7%)
view
16 x 2 TSA-demo/TSA_mecha
TSA-demo/TSA_mecha
servo_actions.py
servo_actions.py
50:65 (16%)
94:109 (16%)
view
16 x 2 TSA-demo/TSA_mecha
TSA-demo/TSA_mecha
servo_actions_local.py
servo_actions_local.py
56:71 (16%)
99:114 (16%)
view
12 x 2 TSA-demo/TSA_mecha
TSA-demo/TSA_mecha
finalflow-mqtt-dev-local.py
finalflow-mqtt-dev-rasp.py
214:225 (4%)
197:208 (4%)
view
11 x 2 TSA-demo/TSA_flight_status
cloudformation-templates...16d79cb9e5cef24fdb8ad22
flight.py
flight.py
24:36 (14%)
9:21 (18%)
view
9 x 2 TSA-demo/TSA_flight_status
cloudformation-templates...light-LasVegasdeparture
flight.py
flight.py
26:36 (12%)
11:21 (15%)
view
7 x 2 TSA-demo/TSA_mecha
TSA-demo/TSA_mecha
servo_actions_local.py
servo_actions_local.py
18:24 (7%)
36:42 (7%)
view
7 x 2 TSA-demo/TSA_mecha
TSA-demo/TSA_mecha
servo_actions.py
servo_actions.py
12:18 (7%)
30:36 (7%)
view
7 x 2 TSA-demo/TSA_mecha
TSA-demo/TSA_mecha
servo_actions.py
servo_actions_local.py
36:46 (7%)
42:52 (7%)
view
6 x 2 TSA-demo/TSA_mecha
TSA-demo/TSA_mecha
servo_actions.py
servo_actions_local.py
62:70 (6%)
68:76 (6%)
view
6 x 2 TSA-demo/TSA_flight_status
TSA-demo/TSA_voice_assistant
flight.py
raspberry_voice_assistant_local.py
14:22 (8%)
23:31 (2%)
view
Duplicated Units
The list of top 11 duplicated units.
See data for all 11 unit duplicates...
Size#FoldersFilesLinesCode
32 x 2 TSA-demo/TSA_voice_assistant
TSA-demo/TSA_voice_assistant
raspberry_voice_assistant_local.py
raspberry_voice_assistant.py
0:0 
0:0 
view
24 x 2 cloudformation-templates...16d79cb9e5cef24fdb8ad22
cloudformation-templates...light-LasVegasdeparture
flight.py
flight.py
0:0 
0:0 
view
26 x 2 TSA-demo/TSA_voice_assistant
TSA-demo/TSA_voice_assistant
raspberry_voice_assistant_local.py
raspberry_voice_assistant.py
0:0 
0:0 
view
15 x 2 cloudformation-templates...16d79cb9e5cef24fdb8ad22
cloudformation-templates...light-LasVegasdeparture
flight.py
flight.py
0:0 
0:0 
view
12 x 2 TSA-demo/TSA_voice_assistant
TSA-demo/TSA_voice_assistant
raspberry_voice_assistant_local.py
raspberry_voice_assistant.py
0:0 
0:0 
view
11 x 2 TSA-demo/TSA_voice_assistant
TSA-demo/TSA_voice_assistant
raspberry_voice_assistant_local.py
raspberry_voice_assistant.py
0:0 
0:0 
view
11 x 2 TSA-demo/TSA_voice_assistant
TSA-demo/TSA_voice_assistant
raspberry_voice_assistant_local.py
raspberry_voice_assistant.py
0:0 
0:0 
view
16 x 2 TSA-demo/TSA_mecha
TSA-demo/TSA_mecha
finalflow-mqtt-dev-local.py
finalflow-mqtt-dev-rasp.py
0:0 
0:0 
view
9 x 2 TSA-demo/TSA_voice_assistant
TSA-demo/TSA_voice_assistant
raspberry_voice_assistant_local.py
raspberry_voice_assistant.py
0:0 
0:0 
view
11 x 2 TSA-demo/TSA_mecha
TSA-demo/TSA_mecha
finalflow-mqtt-dev-local.py
finalflow-mqtt-dev-rasp.py
0:0 
0:0 
view
6 x 2 TSA-demo/TSA_voice_assistant
TSA-demo/TSA_voice_assistant
raspberry_voice_assistant_local.py
raspberry_voice_assistant.py
0:0 
0:0 
view