aws-samples / amazon-ipc-ai-saas
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 54 units with 989 lines of code in units (76.0% of code).
    • 1 very long units (173 lines of code)
    • 1 long units (95 lines of code)
    • 14 medium size units (478 lines of code)
    • 7 small units (105 lines of code)
    • 31 very small units (138 lines of code)
17% | 9% | 48% | 10% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts100% | 0% | 0% | 0% | 0%
py0% | 11% | 58% | 12% | 16%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source/lib100% | 0% | 0% | 0% | 0%
source/lambda0% | 100% | 0% | 0% | 0%
source/simulate0% | 0% | 82% | 0% | 17%
source/containers/face-comparison0% | 0% | 64% | 18% | 17%
source/containers/body-detection0% | 0% | 91% | 0% | 8%
source/containers/face-detection0% | 0% | 91% | 0% | 8%
source/neo0% | 0% | 41% | 38% | 19%
source/export0% | 0% | 58% | 17% | 23%
deployment0% | 0% | 0% | 37% | 62%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in source/lib/ipc-ai-saas-stack.ts
173 1 3
def handler()
in source/lambda/main.py
95 7 2
def visualize()
in source/simulate/face_compare.py
50 2 3
def transformation()
in source/containers/body-detection/detector/predictor.py
49 6 0
def transformation()
in source/containers/face-detection/detector/predictor.py
49 6 0
def detect_and_align()
in source/containers/face-comparison/recognizer/predictor.py
46 6 4
def forward_test()
in source/export/gluoncv_model_export.py
43 6 4
def predict()
in source/containers/face-comparison/recognizer/predictor.py
35 3 4
def get_model()
in source/containers/body-detection/detector/predictor.py
33 6 1
def get_model()
in source/containers/face-detection/detector/predictor.py
33 6 1
def post_process()
in source/neo/eval.py
28 7 4
def compare()
in source/simulate/face_compare.py
25 3 1
def face_detect_simulate()
in source/simulate/detector.py
24 5 1
def transformation()
in source/containers/face-comparison/recognizer/predictor.py
21 2 0
def body_detect_simulate()
in source/simulate/detector.py
21 5 1
def evaluate_inference_speed()
in source/neo/eval.py
21 6 3
def __init__()
in source/neo/eval.py
20 1 6
def get_model()
in source/containers/face-comparison/recognizer/predictor.py
17 4 1
def main()
in deployment/helper.py
17 6 0
14 2 2