awslabs / aws-greengrass-labs-bluetooth-gateway
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 78 units with 961 lines of code in units (80.5% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (57 lines of code)
    • 12 medium size units (294 lines of code)
    • 27 small units (396 lines of code)
    • 38 very small units (214 lines of code)
0% | 5% | 30% | 41% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 5% | 30% | 41% | 22%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 20% | 30% | 42% | 6%
src/ble0% | 0% | 38% | 35% | 25%
esp32-ble-device0% | 0% | 30% | 54% | 14%
src/ipc_pubsub0% | 0% | 24% | 41% | 34%
esp32-ble-device/ble0% | 0% | 22% | 31% | 45%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __init__()
in src/main.py
57 8 2
35 9 3
28 5 3
def _ble_init_connect()
in src/ble/ble_uart_peripheral.py
25 5 1
def advertising_payload()
in esp32-ble-device/ble/ble_advertising.py
25 11 6
def ble_message_callback()
in esp32-ble-device/main.py
25 4 1
def _set_ble_connection_state()
in src/ble/ble_uart_peripheral.py
24 4 1
def run()
in src/ble/ble_uart_peripheral.py
23 11 1
def publish_to_ble()
in src/ble/ble_uart_controller.py
22 3 4
def publish_to_topic()
in src/ipc_pubsub/ipc_topic_pubsub.py
22 7 3
22 4 4
def __init__()
in esp32-ble-device/main.py
22 5 2
def publish_to_mqtt()
in src/ipc_pubsub/mqtt_core_pubsub.py
21 7 3
def publish_message()
in src/main.py
20 6 5
def ble_request_message_router()
in esp32-ble-device/main.py
19 7 2
def connect_ble_device()
in src/ble/ble_uart_controller.py
18 9 2
def __init__()
in esp32-ble-device/ble/ble_uart_peripheral.py
18 2 5
def scan_ble_devices()
in src/ble/ble_scanner.py
17 4 2
def __init__()
in src/ipc_pubsub/mqtt_core_pubsub.py
17 1 4
def __init__()
in src/ipc_pubsub/ipc_topic_pubsub.py
17 1 4