aws-samples / aws-jp-iot-samples
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 29 units with 413 lines of code in units (77.2% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 7 medium size units (256 lines of code)
    • 6 small units (83 lines of code)
    • 16 very small units (74 lines of code)
0% | 0% | 61% | 20% | 17%
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% | 61% | 20% | 17%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
aws-iot-events-for-beginners0% | 0% | 72% | 11% | 16%
aws-iot-greengrass-for-beginners/sensor0% | 0% | 63% | 24% | 12%
aws-iot-greengrass-for-beginners/alert0% | 0% | 58% | 20% | 20%
aws-iot-core-raspberrypi-gpio0% | 0% | 90% | 0% | 10%
amazon-kinesis-video-streams-workshop-jp0% | 0% | 0% | 80% | 20%
aws-iot-greengrass-for-beginners/lambda0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def discover_gg_host()
in aws-iot-greengrass-for-beginners/alert/main.py
45 5 0
def discover_gg_host()
in aws-iot-greengrass-for-beginners/sensor/main.py
45 5 0
def arg_check()
in aws-iot-events-for-beginners/main.py
39 5 0
def device_main()
in aws-iot-events-for-beginners/main.py
38 2 0
def arg_check()
in aws-iot-greengrass-for-beginners/alert/main.py
31 2 0
def arg_check()
in aws-iot-greengrass-for-beginners/sensor/main.py
31 2 0
def main()
in aws-iot-core-raspberrypi-gpio/main.py
27 4 0
def process_record()
in amazon-kinesis-video-streams-workshop-jp/lambda_function.py
16 3 1
def device_main()
in aws-iot-greengrass-for-beginners/sensor/main.py
15 2 0
def exit_sample()
in aws-iot-greengrass-for-beginners/alert/main.py
14 3 1
def exit_sample()
in aws-iot-greengrass-for-beginners/sensor/main.py
14 3 1
def device_main()
in aws-iot-greengrass-for-beginners/alert/main.py
12 3 0
def find_certs_file()
in aws-iot-events-for-beginners/main.py
12 6 0
def exit_sample()
in aws-iot-events-for-beginners/main.py
10 3 1
def on_connection_resumed()
in aws-iot-greengrass-for-beginners/alert/main.py
9 4 4
def lambda_handler()
in aws-iot-greengrass-for-beginners/lambda/lambda_function.py
8 2 2
def find_cert_file()
in aws-iot-greengrass-for-beginners/alert/main.py
6 4 1
def on_resubscribe_complete()
in aws-iot-greengrass-for-beginners/alert/main.py
6 3 1
def find_cert_file()
in aws-iot-greengrass-for-beginners/sensor/main.py
6 4 1
def on_connection_resumed()
in aws-iot-greengrass-for-beginners/sensor/main.py
5 1 4