aws-samples / handling-binary-data-using-api-gateway-http-apis-blog
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 9 units with 119 lines of code in units (51.3% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (55 lines of code)
    • 0 medium size units (0 lines of code)
    • 2 small units (28 lines of code)
    • 6 very small units (36 lines of code)
0% | 46% | 0% | 23% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 46% | 0% | 23% | 30%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
sam-code/img_api0% | 56% | 0% | 12% | 30%
sam-code/echo_api0% | 0% | 0% | 72% | 27%
Alternative Visuals
Longest Units
Top 9 longest units
Unit# linesMcCabe index# params
def lambda_handler()
in sam-code/img_api/app.py
55 3 2
def lambda_handler()
in sam-code/echo_api/echo_raw.py
16 2 2
def decode_img()
in sam-code/img_api/app.py
12 4 4
def encode_img()
in sam-code/img_api/app.py
10 3 2
def get_mime_type()
in sam-code/img_api/app.py
8 4 1
def lambda_handler()
in sam-code/echo_api/echo_json.py
6 1 2
def overlay_noise_on_image()
in sam-code/img_api/app.py
5 1 3
def generate_noise_img()
in sam-code/img_api/app.py
4 1 4
def generate_noise_bytes()
in sam-code/img_api/app.py
3 3 4