aws-samples / aws-lambda-deploy
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 27 units with 258 lines of code in units (59.3% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 3 medium size units (92 lines of code)
    • 5 small units (58 lines of code)
    • 19 very small units (108 lines of code)
0% | 0% | 35% | 22% | 41%
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% | 35% | 22% | 41%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
functions/simple0% | 0% | 42% | 23% | 33%
functions/health_check0% | 0% | 78% | 0% | 21%
functions/update_weight0% | 0% | 0% | 89% | 10%
functions/calculate_weights0% | 0% | 0% | 0% | 100%
functions/finalize0% | 0% | 0% | 0% | 100%
functions/rollback0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def health_check_metrics_errors()
in functions/health_check/health_check.py
33 3 3
def check_errors_in_cloudwatch()
in functions/simple/simple.py
33 1 3
def handler()
in functions/simple/simple.py
26 1 2
def handler()
in functions/update_weight/update_weight.py
13 2 2
def update_weight()
in functions/update_weight/update_weight.py
12 1 4
def update_weight()
in functions/simple/simple.py
11 1 4
def validate_input()
in functions/simple/simple.py
11 1 1
def main()
in functions/simple/simple.py
11 2 0
def linear()
in functions/calculate_weights/calculate_weights.py
9 2 1
def update_weight()
in functions/finalize/finalize.py
9 1 3
def rollback()
in functions/simple/simple.py
9 1 2
def linear()
in functions/simple/simple.py
9 1 1
def rollback()
in functions/rollback/rollback.py
9 1 2
def handler()
in functions/finalize/finalize.py
7 2 2
def finalize()
in functions/simple/simple.py
7 1 3
def generate_weights()
in functions/calculate_weights/calculate_weights.py
6 2 2
def handler()
in functions/health_check/health_check.py
6 1 2
def generate_weights()
in functions/simple/simple.py
6 1 2
def handler()
in functions/rollback/rollback.py
6 1 2
def get_lambda_client()
in functions/simple/simple.py
5 1 0