facebookresearch / higher
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 65 units with 658 lines of code in units (54.0% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (59 lines of code)
    • 9 medium size units (320 lines of code)
    • 3 small units (42 lines of code)
    • 52 very small units (237 lines of code)
0% | 8% | 48% | 6% | 36%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 8% | 48% | 6% | 36%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
higher0% | 8% | 48% | 6% | 36%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __setattr__()
in higher/patch.py
59 18 3
def _update()
in higher/optim.py
48 11 3
def _update()
in higher/optim.py
47 11 3
def _update()
in higher/optim.py
45 11 3
def _update()
in higher/optim.py
33 7 3
def _update()
in higher/optim.py
33 9 3
def _update()
in higher/optim.py
32 8 3
def _update()
in higher/optim.py
29 9 3
def _update()
in higher/optim.py
28 7 3
def _update()
in higher/optim.py
25 8 3
def patched_forward()
in higher/patch.py
18 7 4
def __init__()
in higher/patch.py
12 4 3
def flatten()
in higher/utils.py
12 7 1
def __init__()
in higher/optim.py
10 1 0
def _apply_override()
in higher/optim.py
10 6 2
def _refill_params_box()
in higher/patch.py
9 4 2
def create_diff_optim()
in higher/optim.py
9 1 0
def fast_params()
in higher/patch.py
8 3 2
def _is_container()
in higher/utils.py
8 4 1
def __init__()
in higher/optim.py
8 1 3