aws-samples / sagemaker-inference-samples-kr
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 16 units with 225 lines of code in units (85.2% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 3 medium size units (96 lines of code)
    • 5 small units (72 lines of code)
    • 8 very small units (57 lines of code)
0% | 0% | 42% | 32% | 25%
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% | 42% | 32% | 25%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 0% | 45% | 34% | 19%
code0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 16 longest units
Unit# linesMcCabe index# params
def plot_bbox()
in src/utils.py
42 7 7
def transform_fn()
in src/inference_pytorch.py
28 3 4
def transform_fn()
in src/inference_pytorch_neo.py
26 3 4
def model_fn()
in src/inference_pytorch_neo.py
19 6 1
def input_fn()
in src/inference_pytorch_inf1.py
16 1 2
def input_fn()
in src/inference_mxnet.py
14 2 2
def output_fn()
in src/inference_mxnet.py
12 2 2
def model_fn()
in src/inference_mxnet.py
11 1 1
def predict_fn()
in src/inference_mxnet.py
10 1 2
def delete_endpoint()
in src/utils.py
9 1 2
def input_handler()
in code/inference.py
8 3 2
def get_label_map()
in src/utils.py
8 2 1
7 2 1
def model_fn()
in src/inference_pytorch.py
7 1 1
def output_handler()
in code/inference.py
6 2 2
def _return_error()
in code/inference.py
2 1 2