awslabs / aws-fleet-predictive-maintenance
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 45 units with 576 lines of code in units (59.4% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (77 lines of code)
    • 9 medium size units (240 lines of code)
    • 9 small units (128 lines of code)
    • 26 very small units (131 lines of code)
0% | 13% | 41% | 22% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 13% | 41% | 22% | 22%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
sagemaker/source0% | 58% | 41% | 0% | 0%
sagemaker/source/visualization0% | 0% | 83% | 16% | 0%
sagemaker/source/preprocessing0% | 0% | 65% | 16% | 18%
sagemaker/source/dl_utils0% | 0% | 33% | 33% | 32%
sagemaker/source/dataset0% | 0% | 0% | 51% | 48%
sagemaker/source/config0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def run()
in sagemaker/source/train.py
77 9 0
def pivot_data()
in sagemaker/source/preprocessing/preprocessing.py
35 7 1
def get_dfs_from_hpt()
in sagemaker/source/visualization/model_visualisation_utils.py
30 4 2
def plot_df_list()
in sagemaker/source/visualization/model_visualisation_utils.py
29 4 4
def run_epoch()
in sagemaker/source/train.py
28 5 5
def select_data()
in sagemaker/source/dl_utils/dataset.py
27 2 2
def parse_args()
in sagemaker/source/train.py
26 1 0
def sample_dataset()
in sagemaker/source/preprocessing/preprocessing.py
22 6 2
def model_fn()
in sagemaker/source/dl_utils/inference.py
22 4 1
def get_best_training_job()
in sagemaker/source/visualization/model_visualisation_utils.py
21 7 3
def _generate_sensor_logs()
in sagemaker/source/dataset/dataset_generator.py
18 4 2
def _generate_fleet_info()
in sagemaker/source/dataset/dataset_generator.py
16 3 1
def build_chart()
in sagemaker/source/visualization/plot_utils.py
16 3 2
def __init__()
in sagemaker/source/dataset/dataset_generator.py
15 1 7
def __init__()
in sagemaker/source/dl_utils/dataset.py
15 1 5
def append()
in sagemaker/source/preprocessing/dataframewriter.py
14 7 2
def _build_sensor_output_data()
in sagemaker/source/dl_utils/dataset.py
12 3 4
def gen_sample_array()
in sagemaker/source/dl_utils/stratified_sampler.py
11 1 1
def _get_vehicle_properties_headers()
in sagemaker/source/dl_utils/dataset.py
11 5 2
def flush_buffer()
in sagemaker/source/preprocessing/dataframewriter.py
10 2 1