aws-samples / aws-ai-solution-kit
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 81 units with 1,983 lines of code in units (87.3% of code).
    • 3 very long units (535 lines of code)
    • 3 long units (217 lines of code)
    • 23 medium size units (764 lines of code)
    • 16 small units (245 lines of code)
    • 36 very small units (222 lines of code)
26% | 10% | 38% | 12% | 11%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts64% | 19% | 14% | 0% | <1%
py0% | 4% | 55% | 21% | 18%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source/lib67% | 30% | 0% | 0% | 2%
source/super-resolution-gpu100% | 0% | 0% | 0% | 0%
source/super-resolution-inf1100% | 0% | 0% | 0% | 0%
source/infer-ocr0% | 100% | 0% | 0% | 0%
source/human-seg/src0% | 100% | 0% | 0% | 0%
source/infer-ocr/src0% | 0% | 53% | 27% | 19%
source/super-resolution-gpu/container0% | 0% | 78% | 0% | 21%
source/super-resolution-inf1/container0% | 0% | 78% | 0% | 21%
source/super-resolution/src0% | 0% | 88% | 0% | 11%
source/porn-image0% | 0% | 100% | 0% | 0%
source/super-resolution0% | 0% | 100% | 0% | 0%
source/porn-image/src0% | 0% | 100% | 0% | 0%
source/human-seg0% | 0% | 100% | 0% | 0%
source/lib/s3_to_efs0% | 0% | 0% | 78% | 21%
source/lib/custom_resource0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in source/lib/efs-model-lambda.ts
202 3 3
constructor()
in source/super-resolution-gpu/super-resolution-gpu.ts
167 1 3
constructor()
in source/super-resolution-inf1/super-resolution-inf1.ts
166 1 3
constructor()
in source/lib/ai-kits-rest-api.ts
90 2 3
constructor()
in source/infer-ocr/infer-ocr.ts
75 1 3
def lambda_handler()
in source/human-seg/src/human_seg_app.py
52 4 2
def __call__()
in source/super-resolution-gpu/container/model/predictor.py
50 7 3
def __call__()
in source/super-resolution-inf1/container/model/predictor.py
50 7 3
def lambda_handler()
in source/infer-ocr/src/infer_ocr_app.py
48 5 2
def lambda_handler()
in source/super-resolution/src/super_resolution_app.py
45 5 2
constructor()
in source/porn-image/porn-image.ts
42 1 3
constructor()
in source/super-resolution/super-resolution.ts
41 1 3
def lambda_handler()
in source/porn-image/src/porn_image_app.py
40 4 2
constructor()
in source/human-seg/human-seg.ts
40 1 3
def boxes_from_bitmap()
in source/infer-ocr/src/postprocess/db_postprocess.py
37 7 5
def __init__()
in source/infer-ocr/src/postprocess/rec_postprocess.py
35 7 4
def __init__()
in source/infer-ocr/src/main.py
34 1 1
def resize_image_type0()
in source/infer-ocr/src/imaug/operators.py
33 8 2
def __call__()
in source/infer-ocr/src/main.py
33 8 2
def get_rotate_crop_image()
in source/infer-ocr/src/infer_ocr_app.py
32 2 3