aws-samples / aws-lambda-docker-serverless-inference
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 31 units with 293 lines of code in units (33.4% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 3 medium size units (88 lines of code)
    • 6 small units (92 lines of code)
    • 22 very small units (113 lines of code)
0% | 0% | 30% | 31% | 38%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java0% | 0% | 76% | 0% | 23%
py0% | 0% | 13% | 42% | 44%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
djl-object-detection-inference-docker-lambda0% | 0% | 79% | 0% | 20%
online-machine-learning-aws-lambda0% | 0% | 35% | 40% | 25%
djl-tensorflow-lite-inference-docker-lambda0% | 0% | 73% | 0% | 26%
tensorflow-train-in-sagemaker-deploy-with-lambda0% | 0% | 0% | 64% | 35%
tensorflow-inference-docker-lambda0% | 0% | 0% | 100% | 0%
pytorch-inference-docker-lambda0% | 0% | 0% | 100% | 0%
xgboost-inference-arm64-docker-lambda0% | 0% | 0% | 0% | 100%
xgboost-built-in-algo-train-in-sagemaker-deploy-with-lambda0% | 0% | 0% | 0% | 100%
xgboost-inference-docker-lambda0% | 0% | 0% | 0% | 100%
hebert-sentiment-analysis-inference-docker-lambda0% | 0% | 0% | 0% | 100%
scikit-learn-inference-docker-lambda0% | 0% | 0% | 0% | 100%
blazingtext-text-classification-train-in-sagemaker-deploy-with-lambda0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public void handleRequest()
in djl-object-detection-inference-docker-lambda/src/main/java/com/example/App.java
35 3 3
def lambda_handler()
in online-machine-learning-aws-lambda/app/lambda_training/app.py
28 2 2
public void handleRequest()
in djl-tensorflow-lite-inference-docker-lambda/src/main/java/com/example/App.java
25 2 3
def lambda_handler()
in online-machine-learning-aws-lambda/app/lambda_inference/app.py
20 1 2
def handler()
in tensorflow-train-in-sagemaker-deploy-with-lambda/container/app/app.py
16 2 2
def handler()
in tensorflow-inference-docker-lambda/app/app.py
16 2 2
def handler()
in pytorch-inference-docker-lambda/app/app.py
15 2 2
def model()
in tensorflow-train-in-sagemaker-deploy-with-lambda/mnist-2.py
13 1 4
def _parse_input()
in online-machine-learning-aws-lambda/app/lambda_training/app.py
12 1 1
def handler()
in xgboost-built-in-algo-train-in-sagemaker-deploy-with-lambda/app/app.py
10 1 2
def _parse_args()
in tensorflow-train-in-sagemaker-deploy-with-lambda/mnist-2.py
8 2 0
def call_XGBoost_x86_64_Lambda()
in xgboost-inference-arm64-docker-lambda/invoke_x86_64_arm64_lambdas.py
8 1 0
def call_XGBoost_arm64_Lambda()
in xgboost-inference-arm64-docker-lambda/invoke_x86_64_arm64_lambdas.py
8 1 0
def handler()
in xgboost-inference-docker-lambda/app/app.py
6 1 2
def handler()
in hebert-sentiment-analysis-inference-docker-lambda/app/app.py
6 1 2
def handler()
in scikit-learn-inference-docker-lambda/app/app.py
6 2 2
def handler()
in xgboost-inference-arm64-docker-lambda/app/app.py
6 1 2
def _download_model_from_s3()
in online-machine-learning-aws-lambda/app/lambda_inference/app.py
6 1 1
def handler()
in blazingtext-text-classification-train-in-sagemaker-deploy-with-lambda/container/app/app.py
5 1 2
def _upload_model_to_s3()
in online-machine-learning-aws-lambda/app/lambda_training/app.py
5 1 2