neo-ai / neo-ai-dlr
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 408 units with 4,676 lines of code in units (66.7% of code).
    • 0 very long units (0 lines of code)
    • 6 long units (419 lines of code)
    • 54 medium size units (1,608 lines of code)
    • 77 small units (1,207 lines of code)
    • 271 very small units (1,442 lines of code)
0% | 8% | 34% | 25% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cc0% | 12% | 33% | 31% | 23%
py0% | 6% | 36% | 21% | 35%
js0% | 0% | 33% | 23% | 43%
h0% | 0% | 0% | 0% | 100%
java0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 12% | 32% | 29% | 25%
container0% | 8% | 38% | 22% | 30%
sagemaker-neo-notebooks0% | 13% | 34% | 39% | 12%
python0% | 0% | 22% | 21% | 55%
install0% | 0% | 100% | 0% | 0%
include0% | 0% | 0% | 0% | 100%
aar0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
97 27 1
def _handle_load_model_post()
in container/sagemaker-tensorflow-inferentia/build_artifacts/sagemaker/python_service.py
81 12 3
69 24 1
void CompileNeoModel()
in sagemaker-neo-notebooks/edge/cpp-integration/tutorial.cc
61 7 3
def __init__()
in container/sagemaker-tensorflow-inferentia/build_artifacts/sagemaker/serve.py
59 20 1
void dlr::InitModelPath()
in src/dlr_common.cc
52 17 2
def preprocess()
in container/neo_template_mxnet_byom.py
48 16 2
48 14 1
def preprocess()
in container/neo_template_xgboost.py
45 12 2
void RunInference()
in sagemaker-neo-notebooks/edge/cpp-integration/tutorial.cc
45 5 2
int main()
in sagemaker-neo-notebooks/edge/cpp-integration/tutorial.cc
44 5 2
43 6 1
def _setup_gunicorn()
in container/sagemaker-tensorflow-inferentia/build_artifacts/sagemaker/serve.py
42 9 1
41 10 4
def find_lib_path()
in python/dlr/libpath.py
41 20 3
def create_batching_config()
in container/sagemaker-tensorflow-inferentia/build_artifacts/sagemaker/tfs_utils.py
40 7 1
def __init__()
in python/dlr/dlr_model.py
40 6 6
def tvm_compile()
in container/ec2_compilation_container/tvm_ec2_compiler_utils.py
38 8 4
def _handle_invocation_post()
in container/sagemaker-tensorflow-inferentia/build_artifacts/sagemaker/python_service.py
38 6 4
def on_get()
in container/sagemaker-tensorflow-inferentia/build_artifacts/sagemaker/python_service.py
37 6 4