microsoft / vi-hds
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 344 units with 3,478 lines of code in units (79.4% of code).
    • 1 very long units (122 lines of code)
    • 4 long units (233 lines of code)
    • 34 medium size units (1,089 lines of code)
    • 64 small units (970 lines of code)
    • 241 very small units (1,064 lines of code)
3% | 6% | 31% | 27% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py3% | 6% | 31% | 27% | 30%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
vihds4% | 8% | 29% | 27% | 29%
models0% | 0% | 37% | 30% | 32%
data0% | 0% | 38% | 18% | 43%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __init__()
in vihds/parameters.py
122 33 5
def combined_treatments()
in vihds/plotting.py
66 10 2
def make_images()
in vihds/xval.py
60 7 1
def xval_treatments()
in vihds/plotting.py
54 9 2
53 8 2
def __init__()
in models/dr_constant.py
49 6 7
def xval_individual()
in vihds/plotting.py
48 7 2
def xval_global_parameters()
in vihds/plotting.py
48 17 2
def xval_fit_summary()
in vihds/plotting.py
47 10 3
def xval_variable_parameters()
in vihds/plotting.py
47 18 2
def _evaluate_elbo_and_plot()
in vihds/training.py
47 9 5
def instantiate_from_specs()
in vihds/parameters.py
44 7 3
def run_graph()
in vihds/run_inference_graph.py
40 14 2
def create_parser()
in vihds/run_xval.py
38 3 1
def run()
in vihds/training.py
37 12 1
def load()
in data/procdata.py
35 14 2
def __init__()
in vihds/training.py
34 11 6
def forward()
in models/relay_constant.py
33 4 3
def apply_defaults_params()
in vihds/config.py
33 2 1
def __init__()
in vihds/config.py
31 9 2