awslabs / mlmax
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 86 units with 957 lines of code in units (24.8% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (75 lines of code)
    • 8 medium size units (274 lines of code)
    • 18 small units (267 lines of code)
    • 59 very small units (341 lines of code)
0% | 7% | 28% | 27% | 35%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 7% | 28% | 27% | 35%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
modules/pipeline0% | 27% | 27% | 22% | 23%
src/mlmax0% | 0% | 21% | 31% | 47%
modules/data/src0% | 0% | 100% | 0% | 0%
modules/monitoring0% | 0% | 47% | 21% | 31%
modules/data0% | 0% | 36% | 35% | 27%
modules/environment/util0% | 0% | 0% | 47% | 52%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def example_run_training_pipeline()
in modules/pipeline/training_pipeline_run.py
75 7 2
def example_run_inference_pipeline()
in modules/pipeline/inference_pipeline_run.py
49 3 2
def main()
in modules/data/src/preprocessing.py
49 1 0
def example_run_monitor_pipeline()
in modules/monitoring/monitor_pipeline_run.py
38 2 3
def psi()
in src/mlmax/monitoring.py
31 8 3
def main()
in src/mlmax/monitoring.py
30 7 1
def example_run_data_pipeline()
in modules/data/data_pipeline_run.py
28 2 2
def get_latest_models()
in modules/pipeline/inference_pipeline_run.py
26 1 0
def fit()
in src/mlmax/preprocessing.py
23 1 2
def main()
in src/mlmax/preprocessing.py
19 4 1
def generate_statistic()
in src/mlmax/monitoring.py
19 4 3
def parse_arg()
in src/mlmax/monitoring.py
19 1 0
def __init__()
in modules/pipeline/custom_steps.py
19 1 0
def __init__()
in modules/pipeline/custom_steps.py
18 1 0
def processing()
in modules/environment/util/screening/smconfig.py
17 2 1
def example_create_data_pipeline()
in modules/monitoring/monitor_pipeline_create.py
17 1 0
def __init__()
in modules/data/custom_steps.py
15 1 0
def read_data()
in src/mlmax/preprocessing.py
13 1 1
def transform()
in src/mlmax/preprocessing.py
13 2 3
def read_data()
in src/mlmax/monitoring.py
13 1 1