aws-samples / use-influxdb-and-grafana-to-visualize-ml-output-with-awsiot-greengrass-v2
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 10 units with 145 lines of code in units (52.9% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 3 medium size units (101 lines of code)
    • 1 small units (14 lines of code)
    • 6 very small units (30 lines of code)
0% | 0% | 69% | 9% | 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% | 69% | 9% | 20%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
edge-inference/src0% | 0% | 85% | 0% | 14%
influxdb-subscriber/src0% | 0% | 50% | 20% | 28%
Alternative Visuals
Longest Units
Top 10 longest units
Unit# linesMcCabe index# params
def main()
in modules/edge-inference/src/inference.py
46 3 0
def main()
in modules/influxdb-subscriber/src/main.py
34 3 0
def publishResults()
in modules/edge-inference/src/inference.py
21 2 3
def write_data()
in modules/influxdb-subscriber/src/data2influxdb_v2test.py
14 3 6
def load_class_names()
in modules/edge-inference/src/inference.py
8 2 1
def on_stream_event()
in modules/influxdb-subscriber/src/main.py
8 1 2
def __init__()
in modules/influxdb-subscriber/src/main.py
7 1 6
def softmax()
in modules/edge-inference/src/inference.py
3 1 1
def on_stream_error()
in modules/influxdb-subscriber/src/main.py
2 1 2
def on_stream_closed()
in modules/influxdb-subscriber/src/main.py
2 1 1