aws-samples / aws-iot-device-management-with-fleet-hub-demo
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 23 units with 329 lines of code in units (85.9% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 4 medium size units (113 lines of code)
    • 12 small units (170 lines of code)
    • 7 very small units (46 lines of code)
0% | 0% | 34% | 51% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 34% | 51% | 13%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT0% | 0% | 34% | 51% | 13%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __init__()
in iot_client.py
34 1 1
31 3 1
24 4 4
24 1 1
20 1 1
def init_jobs_client()
in iot_client.py
17 1 1
17 5 1
def execute_job()
in iot_client.py
16 5 2
def report_shadow()
in iot_client.py
15 3 4
def shadow_callback()
in iot_client.py
14 3 4
13 1 1
def jobs_handler()
in iot_client.py
13 2 2
def init_jobs_response()
in iot_client.py
12 5 4
def gen_csr()
in iot_client.py
11 1 2
def acknowledge_job()
in iot_client.py
11 1 2
def reboot()
in iot_client.py
11 1 1
def heartbeater()
in iot_client.py
10 4 1
def init_thing_in_iot()
in iot_client.py
7 1 1
7 3 2
7 2 4