aws / sagemaker-xgboost-container
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 298 units with 2,869 lines of code in units (82.6% of code).
    • 1 very long units (208 lines of code)
    • 3 long units (225 lines of code)
    • 28 medium size units (822 lines of code)
    • 50 small units (721 lines of code)
    • 216 very small units (893 lines of code)
7% | 7% | 28% | 25% | 31%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py7% | 7% | 29% | 24% | 30%
java0% | 0% | 0% | 39% | 60%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/sagemaker_xgboost_container/algorithm_mode22% | 10% | 27% | 20% | 19%
src/sagemaker_xgboost_container/dmlc_patch0% | 32% | 23% | 23% | 20%
src/sagemaker_xgboost_container0% | 0% | 43% | 27% | 28%
src/sagemaker_xgboost_container/mms_patch0% | 0% | 44% | 20% | 34%
src/sagemaker_algorithm_toolkit0% | 0% | 8% | 33% | 57%
docker/1.3-1/resources/mms0% | 0% | 0% | 39% | 60%
src/sagemaker_xgboost_container/metrics0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def initialize()
in src/sagemaker_xgboost_container/algorithm_mode/hyperparameter_validation.py
208 30 1
def train_job()
in src/sagemaker_xgboost_container/algorithm_mode/train.py
98 23 7
def accept_slaves()
in src/sagemaker_xgboost_container/dmlc_patch/tracker.py
69 20 2
def assign_rank()
in src/sagemaker_xgboost_container/dmlc_patch/tracker.py
58 16 6
def sagemaker_train()
in src/sagemaker_xgboost_container/algorithm_mode/train.py
48 11 8
def get_dmatrix()
in src/sagemaker_xgboost_container/data_utils.py
42 14 4
def validate()
in src/sagemaker_algorithm_toolkit/hyperparameter_validation.py
38 16 2
def start()
in src/sagemaker_xgboost_container/checkpointing.py
38 14 1
def start()
in src/sagemaker_xgboost_container/distributed.py
37 9 1
def transform()
in src/sagemaker_xgboost_container/mms_patch/mms_transformer.py
35 11 3
def get_callbacks_watchlist()
in src/sagemaker_xgboost_container/algorithm_mode/train.py
35 12 10
def rabit_run()
in src/sagemaker_xgboost_container/distributed.py
34 7 10
def predict()
in src/sagemaker_xgboost_container/algorithm_mode/serve_utils.py
34 12 5
def __init__()
in src/sagemaker_xgboost_container/distributed.py
32 11 7
def get_selected_predictions()
in src/sagemaker_xgboost_container/algorithm_mode/serve_utils.py
32 13 4
def invocations()
in src/sagemaker_xgboost_container/algorithm_mode/serve.py
31 8 0
def _set_mms_configs()
in src/sagemaker_xgboost_container/serving_mms.py
30 7 2
def _get_csv_dmatrix_pipe_mode()
in src/sagemaker_xgboost_container/data_utils.py
28 10 2
def parse_content_data()
in src/sagemaker_xgboost_container/algorithm_mode/serve_utils.py
28 7 2
def record()
in src/sagemaker_xgboost_container/prediction_utils.py
27 6 3