aws-samples / sagemaker-end-to-end-workshop
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 27 units with 556 lines of code in units (61.8% of code).
    • 0 very long units (0 lines of code)
    • 3 long units (212 lines of code)
    • 3 medium size units (126 lines of code)
    • 8 small units (136 lines of code)
    • 13 very small units (82 lines of code)
0% | 38% | 22% | 24% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 38% | 22% | 24% | 14%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
4-Deployment/Batch/config0% | 44% | 23% | 20% | 11%
4-Deployment/RealTime/config0% | 46% | 25% | 21% | 6%
5-Monitoring/config0% | 62% | 0% | 16% | 21%
6-Pipelines/config0% | 0% | 43% | 36% | 20%
5-Monitoring0% | 0% | 0% | 87% | 12%
ROOT0% | 0% | 0% | 0% | 100%
3-Evaluation/solutions0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def get_estimator_from_lab2()
in 4-Deployment/Batch/config/solution_lab2.py
80 5 2
def get_estimator_from_lab2()
in 4-Deployment/RealTime/config/solution_lab2.py
76 2 2
def get_endpoint_from_lab4()
in 5-Monitoring/config/solution_lab4.py
56 5 0
def main()
in 4-Deployment/Batch/config/xgboost_customer_churn.py
42 5 0
def main()
in 4-Deployment/RealTime/config/xgboost_customer_churn.py
42 5 0
def main()
in 6-Pipelines/config/xgboost_customer_churn.py
42 5 0
def parse_args()
in 4-Deployment/Batch/config/xgboost_customer_churn.py
20 1 0
def parse_args()
in 4-Deployment/RealTime/config/xgboost_customer_churn.py
20 1 0
def parse_args()
in 6-Pipelines/config/xgboost_customer_churn.py
20 1 0
def model_fn()
in 4-Deployment/Batch/config/xgboost_customer_churn.py
17 5 1
def model_fn()
in 4-Deployment/RealTime/config/xgboost_customer_churn.py
15 5 1
def model_fn()
in 5-Monitoring/config/inference.py
15 5 1
def model_fn()
in 6-Pipelines/config/xgboost_customer_churn.py
15 5 1
def preprocess_handler()
in 5-Monitoring/preprocessor.py
14 1 1
def create_smdebug_hook()
in 4-Deployment/Batch/config/xgboost_customer_churn.py
10 1 5
def create_smdebug_hook()
in 4-Deployment/RealTime/config/xgboost_customer_churn.py
10 1 5
def create_smdebug_hook()
in 6-Pipelines/config/xgboost_customer_churn.py
10 1 5
def get_dataset()
in 6-Pipelines/config/evaluate.py
10 4 2
def output_fn()
in 5-Monitoring/config/inference.py
9 3 2
def input_fn()
in 5-Monitoring/config/inference.py
8 2 2