aws-samples / amazon-sagemaker-edge-manager-demo
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 54 units with 806 lines of code in units (77.4% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (80 lines of code)
    • 9 medium size units (328 lines of code)
    • 20 small units (275 lines of code)
    • 24 very small units (123 lines of code)
0% | 9% | 40% | 34% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ino0% | 68% | 30% | 0% | <1%
py0% | 0% | 42% | 39% | 17%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
02_Firmware/windturbine0% | 68% | 30% | 0% | <1%
04_EdgeApplication/turbine0% | 0% | 38% | 44% | 17%
04_EdgeApplication/report0% | 0% | 75% | 25% | 0%
04_EdgeApplication0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
ino
void loop()
in 02_Firmware/windturbine/windturbine.ino
80 16 0
def __process_job__()
in 04_EdgeApplication/turbine/ota.py
49 7 3
def lambda_handler()
in 04_EdgeApplication/report/lambda_ingest_logs_elasticsearch.py
44 12 2
def add_AgentServicer_to_server()
in 04_EdgeApplication/turbine/agent_pb2_grpc.py
41 1 2
def __init__()
in 04_EdgeApplication/turbine/ota.py
41 7 7
ino
void setup()
in 02_Firmware/windturbine/windturbine.ino
36 6 0
def __init__()
in 04_EdgeApplication/turbine/agent_pb2_grpc.py
36 1 2
def lambda_handler()
in 04_EdgeApplication/report/lambda_ingest_logs_cloudwatch.py
31 12 2
def __on_message__()
in 04_EdgeApplication/turbine/ota.py
25 9 4
def predict()
in 04_EdgeApplication/turbine/edgeagentclient.py
25 5 4
def get_client()
in 04_EdgeApplication/turbine/util.py
18 1 2
def Predict()
in 04_EdgeApplication/turbine/agent_pb2_grpc.py
15 1 3
def LoadModel()
in 04_EdgeApplication/turbine/agent_pb2_grpc.py
15 1 3
def UnLoadModel()
in 04_EdgeApplication/turbine/agent_pb2_grpc.py
15 1 3
def ListModels()
in 04_EdgeApplication/turbine/agent_pb2_grpc.py
15 1 3
def DescribeModel()
in 04_EdgeApplication/turbine/agent_pb2_grpc.py
15 1 3
def CaptureData()
in 04_EdgeApplication/turbine/agent_pb2_grpc.py
15 1 3
def GetCaptureDataStatus()
in 04_EdgeApplication/turbine/agent_pb2_grpc.py
15 1 3
def __upload_logs__()
in 04_EdgeApplication/turbine/logger.py
15 2 1
def __update_job_status__()
in 04_EdgeApplication/turbine/ota.py
15 1 4