aws-samples / simple-smart-mirror
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 226 units with 1,569 lines of code in units (58.4% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (106 lines of code)
    • 9 medium size units (266 lines of code)
    • 29 small units (419 lines of code)
    • 186 very small units (778 lines of code)
0% | 6% | 16% | 26% | 49%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 6% | 16% | 26% | 49%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
smart-mirror-full/extracted/device/script/src/agt0% | 17% | 32% | 12% | 38%
smart-mirror-full/extracted/device/script0% | 12% | 33% | 24% | 29%
smart-mirror-full/extracted/device/script/src/agt/ble0% | 0% | 8% | 20% | 71%
smart-mirror-full/extracted/device/script/src/agt/bt_classic0% | 0% | 0% | 37% | 62%
smart-mirror-full/extracted/lambda/custom0% | 0% | 0% | 50% | 49%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __init__()
in smart-mirror-full/extracted/device/script/src/agt/alexa_gadget.py
54 24 2
def intro()
in smart-mirror-full/extracted/device/script/smart_mirror.py
52 13 1
def on_alexa_discovery_discover()
in smart-mirror-full/extracted/device/script/src/agt/alexa_gadget.py
48 14 2
def main()
in smart-mirror-full/extracted/device/script/src/agt/alexa_gadget.py
33 7 1
def loop()
in smart-mirror-full/extracted/device/script/agt_smart_mirror.py
32 13 1
def __init__()
in smart-mirror-full/extracted/device/script/src/agt/ble/adapter.py
29 3 5
def readParameters()
in smart-mirror-full/extracted/device/script/parameter_store_helper.py
28 7 1
def on_alerts_setalert()
in smart-mirror-full/extracted/device/script/agt_smart_mirror.py
27 6 2
def blink_color()
in smart-mirror-full/extracted/device/script/smart_mirror.py
25 10 4
def getCurrentTimerPosition()
in smart-mirror-full/extracted/device/script/agt_smart_mirror.py
23 2 1
def _on_bluetooth_data_received()
in smart-mirror-full/extracted/device/script/src/agt/alexa_gadget.py
21 4 2
def __init__()
in smart-mirror-full/extracted/device/script/agt_smart_mirror.py
20 6 1
def property_changed()
in smart-mirror-full/extracted/device/script/src/agt/ble/adapter.py
20 6 5
def fetch_and_store_parameters()
in smart-mirror-full/extracted/device/script/parameter_store_helper.py
20 4 0
def launch_request_handler()
in smart-mirror-full/extracted/lambda/custom/lambda_function.py
20 3 1
def wheel()
in smart-mirror-full/extracted/device/script/smart_mirror.py
18 6 2
def yes_intent_handler()
in smart-mirror-full/extracted/lambda/custom/lambda_function.py
18 2 1
def __init__()
in smart-mirror-full/extracted/device/script/src/agt/ble/adapter.py
16 1 9
def build_start_event_handler_directive()
in smart-mirror-full/extracted/lambda/custom/lambda_function.py
16 1 6
def _create_eir()
in smart-mirror-full/extracted/device/script/src/agt/bt_classic/adapter.py
15 5 1