aws-samples / aws-cloudfront-realtime-monitoring
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 8 units with 140 lines of code in units (37.5% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 3 medium size units (101 lines of code)
    • 1 small units (18 lines of code)
    • 4 very small units (21 lines of code)
0% | 0% | 72% | 12% | 15%
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% | 72% | 12% | 15%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
custom-resource0% | 0% | 80% | 0% | 20%
log-processor0% | 0% | 64% | 25% | 10%
Alternative Visuals
Longest Units
Top 8 longest units
Unit# linesMcCabe index# params
def lambda_handler()
in log-processor/lambda_function.py
45 17 2
def create_realtime_logs_configuration()
in custom-resource/lambda_function.py
32 3 1
def start_kda_app()
in custom-resource/lambda_function.py
24 3 1
def parse_headers()
in log-processor/lambda_function.py
18 7 2
def create()
in custom-resource/lambda_function.py
10 3 2
def write_batch_timestream()
in log-processor/lambda_function.py
7 2 2
def no_op()
in custom-resource/lambda_function.py
2 1 2
def lambda_handler()
in custom-resource/lambda_function.py
2 1 2