aws-samples / aws-iot-greengrass-edge-analytics-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 12 units with 777 lines of code in units (75.1% of code).
    • 1 very long units (552 lines of code)
    • 1 long units (62 lines of code)
    • 4 medium size units (108 lines of code)
    • 2 small units (29 lines of code)
    • 4 very small units (26 lines of code)
71% | 7% | 13% | 3% | 3%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts100% | 0% | 0% | 0% | 0%
py0% | 27% | 48% | 12% | 11%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib100% | 0% | 0% | 0% | 0%
lib/custom-certificate-handler0% | 70% | 29% | 0% | 0%
lib/greengrass-service-role-handler0% | 0% | 100% | 0% | 0%
lib/analyzer-lambda0% | 0% | 50% | 24% | 26%
lib/receiver-lambda0% | 0% | 0% | 56% | 43%
Alternative Visuals
Longest Units
Top 12 longest units
Unit# linesMcCabe index# params
constructor()
in lib/edge-analytics-stack.ts
552 1 3
def handler()
in lib/custom-certificate-handler/custom-certificate-lambda.py
62 7 2
def handler()
in lib/greengrass-service-role-handler/greengrass-service-role-lambda.py
31 5 2
def send()
in lib/custom-certificate-handler/cfnresponse.py
26 3 6
def send()
in lib/greengrass-service-role-handler/cfnresponse.py
26 3 6
def handler()
in lib/analyzer-lambda/analyzer-lambda.py
25 4 2
def handler()
in lib/receiver-lambda/receiver-lambda.py
17 1 2
def select_metrics()
in lib/analyzer-lambda/analyzer-lambda.py
12 2 4
def store_metrics()
in lib/receiver-lambda/receiver-lambda.py
8 1 3
def get_source_dataframe()
in lib/analyzer-lambda/analyzer-lambda.py
8 1 2
def callDownstreamLambda()
in lib/receiver-lambda/receiver-lambda.py
5 1 2
def callDownstreamLambda()
in lib/analyzer-lambda/analyzer-lambda.py
5 1 2