facebookresearch / fbooja
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 64 units with 1,052 lines of code in units (29.2% of code).
    • 2 very long units (282 lines of code)
    • 6 long units (440 lines of code)
    • 5 medium size units (106 lines of code)
    • 8 small units (109 lines of code)
    • 43 very small units (115 lines of code)
26% | 41% | 10% | 10% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py26% | 41% | 10% | 10% | 10%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT26% | 41% | 10% | 10% | 10%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def bootstrap2()
in bootstrap2.py
143 12 10
def bootstrap()
in bootstrap.py
139 11 10
def cs_fft()
in admm.py
89 29 7
def cs_fft()
in admm2.py
89 27 7
def jackknife2()
in jackknife2.py
77 8 7
def jackknife()
in jackknife.py
72 10 7
58 10 8
55 9 8
def randradialineset()
in radialines.py
22 5 3
def testbootstrap()
in bootstrap.py
21 3 8
def adm()
in admm.py
21 6 6
def _fft()
in ctorch.py
21 3 4
def adm()
in admm2.py
21 6 6
def testjackknife()
in jackknife.py
18 3 6
16 3 7
def zero_pad()
in admm.py
14 4 4
def testbootstrap2()
in bootstrap2.py
14 1 8
def zero_pad()
in admm2.py
13 3 4
12 2 7
def __mul__()
in ctorch.py
11 4 2