aws / deep-learning-containers
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 307 units with 3,750 lines of code in units (40.1% of code).
    • 1 very long units (131 lines of code)
    • 5 long units (327 lines of code)
    • 41 medium size units (1,242 lines of code)
    • 62 small units (935 lines of code)
    • 198 very small units (1,115 lines of code)
3% | 8% | 33% | 24% | 29%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py3% | 9% | 33% | 25% | 27%
js0% | 0% | 33% | 23% | 43%
c0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src9% | 3% | 33% | 25% | 28%
tensorflow0% | 14% | 34% | 22% | 28%
scheduler0% | 0% | 38% | 38% | 23%
pytorch0% | 0% | 34% | 29% | 36%
release0% | 0% | 0% | 40% | 60%
ROOT0% | 0% | 0% | 0% | 100%
habana0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def image_builder()
in src/image_builder.py
131 39 1
def _handle_load_model_post()
in tensorflow/inference/docker/build_artifacts/sagemaker/python_service.py
81 12 3
def _handle_load_model_post()
in tensorflow/inference/docker/build_artifacts/sagemaker_neuron/python_service.py
80 12 3
def __init__()
in tensorflow/inference/docker/build_artifacts/sagemaker/serve.py
57 12 1
def __init__()
in tensorflow/inference/docker/build_artifacts/sagemaker_neuron/serve.py
55 11 1
def main()
in src/main.py
54 42 0
def main()
in pytorch/training/docker/build_artifacts/mnist.py
48 6 0
def _setup_gunicorn()
in tensorflow/inference/docker/build_artifacts/sagemaker/serve.py
42 9 1
def start()
in tensorflow/inference/docker/build_artifacts/sagemaker_neuron/serve.py
41 12 1
def create_batching_config()
in tensorflow/inference/docker/build_artifacts/sagemaker_neuron/tfs_utils.py
40 7 1
def create_batching_config()
in tensorflow/inference/docker/build_artifacts/sagemaker/tfs_utils.py
40 7 1
39 19 2
def _handle_invocation_post()
in tensorflow/inference/docker/build_artifacts/sagemaker/python_service.py
38 6 4
def on_get()
in tensorflow/inference/docker/build_artifacts/sagemaker_neuron/python_service.py
37 6 4
def _setup_gunicorn()
in tensorflow/inference/docker/build_artifacts/sagemaker_neuron/serve.py
37 9 1
def on_get()
in tensorflow/inference/docker/build_artifacts/sagemaker/python_service.py
37 6 4
def _handle_invocation_post()
in tensorflow/inference/docker/build_artifacts/sagemaker_neuron/python_service.py
35 5 4
def run_test_job()
in src/start_testbuilds.py
34 2 3
def docker_build()
in src/image.py
34 5 3
def main()
in src/start_testbuilds.py
33 14 0