aws-samples / aws-serverless-failure-modes
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 113 lines of code in units (16.1% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 0 medium size units (0 lines of code)
    • 6 small units (82 lines of code)
    • 6 very small units (31 lines of code)
0% | 0% | 0% | 72% | 27%
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% | 0% | 72% | 27%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lambda/api0% | 0% | 0% | 85% | 14%
lambda/dynamo_stream0% | 0% | 0% | 100% | 0%
lambda/sqs0% | 0% | 0% | 100% | 0%
ROOT0% | 0% | 0% | 0% | 100%
lambda/kinesis_stream0% | 0% | 0% | 0% | 100%
lambda/async0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 12 longest units
Unit# linesMcCabe index# params
def post_events()
in lambda/api/app.py
17 3 0
def post_kinesis()
in lambda/api/app.py
16 3 0
def lambda_handler()
in lambda/dynamo_stream/app.py
13 7 2
def lambda_handler()
in lambda/sqs/app.py
12 4 2
def post_dynamo()
in lambda/api/app.py
12 3 0
def post_sqs()
in lambda/api/app.py
12 3 0
def get_error()
in lambda/api/app.py
8 4 0
def lambda_handler()
in lambda/kinesis_stream/app.py
8 4 2
def api_call()
in test.py
5 2 3
def lambda_handler()
in lambda/async/app.py
5 2 2
3 1 0
def lambda_handler()
in lambda/api/app.py
2 1 2