microsoft / MLOpsPython
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 55 units with 1,043 lines of code in units (49.2% of code).
    • 2 very long units (244 lines of code)
    • 2 long units (144 lines of code)
    • 12 medium size units (379 lines of code)
    • 10 small units (138 lines of code)
    • 29 very small units (138 lines of code)
23% | 13% | 36% | 13% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py23% | 13% | 36% | 13% | 13%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ml_service/pipelines30% | 11% | 44% | 5% | 6%
diabetes_regression/register85% | 0% | 0% | 0% | 14%
diabetes_regression/training0% | 73% | 0% | 8% | 17%
diabetes_regression/scoring0% | 0% | 52% | 31% | 15%
bootstrap0% | 0% | 52% | 20% | 26%
ml_service/util0% | 0% | 54% | 37% | 7%
diabetes_regression/util0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in ml_service/pipelines/diabetes_regression_build_train_pipeline.py
136 9 0
def main()
in diabetes_regression/register/register_model.py
108 12 0
def main()
in diabetes_regression/training/train_aml.py
92 8 0
def main()
in ml_service/pipelines/run_train_pipeline.py
52 10 0
def parse_args()
in diabetes_regression/scoring/parallel_batchscore.py
45 16 0
def build_batchscore_pipeline()
in ml_service/pipelines/diabetes_regression_build_parallel_batchscore_pipeline.py
40 2 0
def main()
in ml_service/pipelines/diabetes_regression_build_train_pipeline_with_r.py
40 2 0
def main()
in ml_service/pipelines/diabetes_regression_build_train_pipeline_with_r_on_dbricks.py
37 2 0
def replace_project_name()
in bootstrap/bootstrap.py
34 3 3
def copy_output()
in ml_service/pipelines/run_parallel_batchscore_pipeline.py
31 1 2
def main()
in bootstrap/bootstrap.py
27 2 1
def get_compute()
in ml_service/util/attach_compute.py
26 9 4
def copy_output()
in diabetes_regression/scoring/parallel_batchscore_copyoutput.py
25 1 1
def run_batchscore_pipeline()
in ml_service/pipelines/run_parallel_batchscore_pipeline.py
25 3 0
def main()
in ml_service/util/smoke_test_scoring_service.py
25 2 0
def get_fallback_input_dataset()
in ml_service/pipelines/diabetes_regression_build_parallel_batchscore_pipeline.py
24 3 2
def call_web_service()
in ml_service/util/smoke_test_scoring_service.py
19 3 3
def init()
in diabetes_regression/scoring/parallel_batchscore.py
16 2 0
def call_web_app()
in ml_service/util/smoke_test_scoring_service.py
16 4 2
def run()
in diabetes_regression/scoring/parallel_batchscore.py
15 5 1