aws-samples / easy-amazon-sagemaker-deployments
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 49 units with 703 lines of code in units (63.5% of code).
    • 1 very long units (168 lines of code)
    • 0 long units (0 lines of code)
    • 7 medium size units (211 lines of code)
    • 9 small units (144 lines of code)
    • 32 very small units (180 lines of code)
23% | 0% | 30% | 20% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py23% | 0% | 30% | 20% | 25%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ezsmdeploy37% | 0% | 37% | 22% | 2%
ezsmdeploy/data0% | 0% | 27% | 13% | 59%
notebooks0% | 0% | 16% | 25% | 58%
notebooks/src0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def deploy()
in ezsmdeploy/__init__.py
168 20 1
def process_instance_type()
in ezsmdeploy/__init__.py
39 7 1
def choose_instance_type()
in ezsmdeploy/__init__.py
39 15 1
def autoscale_endpoint()
in ezsmdeploy/__init__.py
31 1 1
def tar_model()
in ezsmdeploy/__init__.py
29 8 1
def deploy_model()
in ezsmdeploy/__init__.py
28 3 1
def my_task()
in ezsmdeploy/data/smlocust.py
23 2 1
def predict()
in notebooks/modelscript_mxnet.py
22 6 2
def __init__()
in ezsmdeploy/__init__.py
20 1 0
def create_model()
in ezsmdeploy/__init__.py
20 3 1
def predict()
in notebooks/modelscript_tensorflow_lite.py
19 3 2
def upload_model()
in ezsmdeploy/__init__.py
16 3 1
def handle_requirements()
in ezsmdeploy/__init__.py
16 4 1
def build_docker()
in ezsmdeploy/__init__.py
16 2 1
def predict()
in notebooks/modelscript_pytorch.py
14 4 2
def makedir_safe()
in ezsmdeploy/__init__.py
12 4 2
def initialize()
in ezsmdeploy/data/model_handler.py
11 1 2
def load_model()
in notebooks/modelscript_ensemble_sklearn.py
10 1 1
def load_model()
in notebooks/src/transformscript.py
10 1 1
def predict()
in notebooks/modelscript_tensorflow.py
10 3 2