awslabs / aws-greengrass-labs-iot-pubsub-framework
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 34 units with 453 lines of code in units (79.6% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 8 medium size units (214 lines of code)
    • 10 small units (145 lines of code)
    • 16 very small units (94 lines of code)
0% | 0% | 47% | 32% | 20%
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% | 47% | 32% | 20%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/pubsub0% | 0% | 56% | 25% | 18%
src0% | 0% | 36% | 40% | 22%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __init__()
in src/main.py
39 9 2
36 18 3
def get_pubsub_request()
in src/pubsub/pubsub_messages.py
27 3 5
def get_pubsub_response()
in src/pubsub/pubsub_messages.py
24 5 5
def get_pubsub_update()
in src/pubsub/pubsub_messages.py
24 5 4
def publish_to_topic()
in src/pubsub/ipc_pubsub.py
22 7 3
def init_mqtt_subscriber()
in src/pubsub/mqtt_pubsub.py
21 5 1
def publish_to_mqtt()
in src/pubsub/mqtt_pubsub.py
21 7 3
def init_topic_subscriber()
in src/pubsub/ipc_pubsub.py
20 5 1
18 3 1
def __init__()
in src/pubsub/mqtt_pubsub.py
16 1 4
def __init__()
in src/pubsub/ipc_pubsub.py
15 1 4
def publish_message()
in src/main.py
14 5 4
13 3 5
13 3 5
13 3 5
def service_loop()
in src/main.py
12 4 1
def init_topic_publisher()
in src/pubsub/ipc_pubsub.py
11 2 1
def init_mqtt_publisher()
in src/pubsub/mqtt_pubsub.py
10 2 1
def on_stream_event()
in src/pubsub/mqtt_pubsub.py
8 2 2