aws-samples / aws-greengrass-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 23 units with 337 lines of code in units (60.9% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (120 lines of code)
    • 3 medium size units (83 lines of code)
    • 6 small units (84 lines of code)
    • 12 very small units (50 lines of code)
0% | 35% | 24% | 24% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 35% | 24% | 24% | 14%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
traffic-light-example-python0% | 58% | 17% | 16% | 7%
iot-blog/image-classification-connector-and-feedback/part_20% | 0% | 40% | 32% | 27%
iot-blog/image-classification-connector-and-feedback/part_10% | 0% | 60% | 0% | 40%
hello-world-counter-python0% | 0% | 0% | 100% | 0%
hello-world-python0% | 0% | 0% | 88% | 11%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def discoverGGC()
in traffic-light-example-python/trafficLight.py
60 13 5
def discoverGGC()
in traffic-light-example-python/lightController.py
60 13 5
def function_handler()
in traffic-light-example-python/carAggregator.py
35 6 2
def get_inference()
in iot-blog/image-classification-connector-and-feedback/part_2/beverageclassifier.py
24 4 1
def get_inference()
in iot-blog/image-classification-connector-and-feedback/part_1/beverageclassifier.py
24 4 1
def function_handler()
in iot-blog/image-classification-connector-and-feedback/part_2/beverageclassifier.py
19 3 2
def function_handler()
in hello-world-counter-python/greengrassHelloWorldCounter.py
16 2 2
def greengrass_hello_world_run()
in hello-world-python/greengrassHelloWorld.py
15 3 0
def customShadowCallback_Delta()
in traffic-light-example-python/trafficLight.py
12 2 3
def customShadowCallback_Update()
in traffic-light-example-python/trafficLight.py
11 5 3
def customShadowCallback_Update()
in traffic-light-example-python/lightController.py
11 5 3
def function_handler()
in iot-blog/image-classification-connector-and-feedback/part_1/beverageclassifier.py
10 1 2
def upload_to_s3()
in iot-blog/image-classification-connector-and-feedback/part_2/beverageclassifier.py
6 2 2
def isIpAddress()
in traffic-light-example-python/trafficLight.py
5 2 1
def isIpAddress()
in traffic-light-example-python/lightController.py
5 2 1
def create_image_filename()
in iot-blog/image-classification-connector-and-feedback/part_2/beverageclassifier.py
4 1 0
def create_s3_filename()
in iot-blog/image-classification-connector-and-feedback/part_2/beverageclassifier.py
4 3 3
def create_image_filename()
in iot-blog/image-classification-connector-and-feedback/part_1/beverageclassifier.py
4 1 0
def getGGCAddr()
in traffic-light-example-python/trafficLight.py
3 1 1
def getGGCAddr()
in traffic-light-example-python/lightController.py
3 1 1