facebookresearch / certified-removal
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 37 units with 493 lines of code in units (84.3% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (81 lines of code)
    • 3 medium size units (96 lines of code)
    • 10 small units (150 lines of code)
    • 23 very small units (166 lines of code)
0% | 16% | 19% | 30% | 33%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 16% | 19% | 30% | 33%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT0% | 20% | 24% | 23% | 31%
fast_grad0% | 0% | 0% | 56% | 43%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in train_svhn.py
81 10 0
44 9 1
def train_private()
in train_func.py
28 6 12
def train()
in train_func.py
24 9 9
def forward()
in fast_grad_conv.py
18 3 2
def forward()
in fast_grad_models.py
17 3 2
def profiling()
in fast_grad/helpers.py
16 1 8
15 3 3
15 4 6
15 4 7
def check_correctness()
in fast_grad/helpers.py
14 1 6
14 3 5
def naive()
in fast_grad/gradient_funcs.py
13 3 3
def simpleTiming()
in fast_grad/helpers.py
13 1 7
def __init__()
in models.py
10 3 2
def goodfellow_backprop()
in fast_grad/goodfellow_backprop.py
10 2 2
def __init__()
in fast_grad_models.py
10 3 2
def backward()
in fast_grad_conv.py
8 2 3
def __init__()
in models.py
8 2 7
def forward()
in models.py
8 3 2