facebookresearch / deep-variance-reduction
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 172 units with 3,047 lines of code in units (80.0% of code).
    • 1 very long units (465 lines of code)
    • 7 long units (500 lines of code)
    • 36 medium size units (1,142 lines of code)
    • 38 small units (544 lines of code)
    • 90 very small units (396 lines of code)
15% | 16% | 37% | 17% | 12%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py15% | 16% | 37% | 17% | 12%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT17% | 11% | 37% | 19% | 14%
reproduce0% | 58% | 37% | 4% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def run()
in run.py
465 1 1
def cifar10()
in problems.py
98 18 1
88 27 3
def plot_averaged()
in reproduce/plot_test_error_with_bars.py
71 15 4
def plot_variance_ratios()
in reproduce/plot_variance_ratio.py
62 13 3
def epoch_diagnostics()
in torch_svrg.py
62 6 5
def scsg_diagnostics()
in diagnostics.py
61 11 6
def plot_averaged()
in reproduce/plot_test_error.py
58 12 4
50 13 7
def logging_pass_end()
in torch_svrg.py
46 6 2
def step()
in recompute_svrg.py
44 7 3
def train_scsg()
in run_vr.py
44 12 8
def labelLine()
in reproduce/label_lines.py
43 16 5
def __init__()
in UpdatedDataLoaderMult.py
43 9 2
def __init__()
in resnext.py
42 13 9
def imagenet()
in problems.py
41 7 1
def plot_variance_raw()
in reproduce/plot_transform_locking.py
40 6 3
def step()
in torch_svrg.py
40 8 3
def plot_dist()
in reproduce/plot_iterate_distance.py
38 6 4
def minibatch_stats()
in diagnostics.py
38 8 0