aws-samples / amazon-sagemaker-edge-manager-workshop
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 165 units with 1,630 lines of code in units (54.3% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (52 lines of code)
    • 16 medium size units (523 lines of code)
    • 37 small units (519 lines of code)
    • 111 very small units (536 lines of code)
0% | 3% | 32% | 31% | 32%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 3% | 32% | 31% | 32%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
setup0% | 100% | 0% | 0% | 0%
lab/03-Package-Deploy/iot-jobs/app0% | 0% | 39% | 30% | 30%
lab/03-Package-Deploy/greengrass-v2/artifacts/aws.samples.windturbine.detector/1.0.0/inference0% | 0% | 27% | 37% | 35%
lab/simulator0% | 0% | 30% | 14% | 55%
lab/02-Training0% | 0% | 33% | 50% | 15%
lab/01-Data-Visualization0% | 0% | 0% | 79% | 20%
lab/03-Package-Deploy/greengrass-v2/artifacts/aws.samples.windturbine.detector/1.0.00% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def setup_agent()
in setup/run.py
52 5 4
def __process_job__()
in lab/03-Package-Deploy/iot-jobs/app/ota.py
42 7 3
def __init__()
in lab/simulator/turbine.py
41 5 4
def add_AgentServicer_to_server()
in lab/03-Package-Deploy/greengrass-v2/artifacts/aws.samples.windturbine.detector/1.0.0/inference/agent_pb2_grpc.py
41 1 2
def add_AgentServicer_to_server()
in lab/03-Package-Deploy/iot-jobs/app/agent_pb2_grpc.py
41 1 2
def __init__()
in lab/03-Package-Deploy/iot-jobs/app/ota.py
40 6 7
def train()
in lab/02-Training/wind_turbine.py
39 8 1
def __init__()
in lab/03-Package-Deploy/greengrass-v2/artifacts/aws.samples.windturbine.detector/1.0.0/inference/agent_pb2_grpc.py
36 1 2
def __init__()
in lab/03-Package-Deploy/iot-jobs/app/agent_pb2_grpc.py
36 1 2
def __init__()
in lab/03-Package-Deploy/greengrass-v2/artifacts/aws.samples.windturbine.detector/1.0.0/inference/windturbine.py
33 6 5
def __init__()
in lab/03-Package-Deploy/iot-jobs/app/turbine.py
30 4 3
def __detect_anomalies__()
in lab/03-Package-Deploy/iot-jobs/app/windfarm.py
29 10 1
def predict()
in lab/03-Package-Deploy/greengrass-v2/artifacts/aws.samples.windturbine.detector/1.0.0/inference/edgeagentclient.py
25 5 4
def predict()
in lab/03-Package-Deploy/iot-jobs/app/edgeagentclient.py
25 5 4
def connect()
in lab/simulator/mqttclient.py
23 1 1
def __init__()
in lab/03-Package-Deploy/iot-jobs/app/windfarm.py
21 7 4
def __on_message__()
in lab/03-Package-Deploy/iot-jobs/app/ota.py
21 9 4
def create_model()
in lab/02-Training/wind_turbine.py
18 1 2
def train_epoch()
in lab/02-Training/wind_turbine.py
17 5 6
def __detect_anomalies__()
in lab/03-Package-Deploy/greengrass-v2/artifacts/aws.samples.windturbine.detector/1.0.0/inference/windturbine.py
17 3 2