facebookresearch / rcpm
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 104 units with 968 lines of code in units (72.1% of code).
    • 0 very long units (0 lines of code)
    • 3 long units (184 lines of code)
    • 10 medium size units (270 lines of code)
    • 11 small units (152 lines of code)
    • 80 very small units (362 lines of code)
0% | 19% | 27% | 15% | 37%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 19% | 27% | 15% | 37%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT0% | 19% | 27% | 15% | 37%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
74 9 1
def train_kl()
in main.py
57 6 1
def main()
in plot-demo.py
53 2 0
def main()
in plot-components.py
49 4 0
def __call__()
in flows.py
29 1 3
def setup()
in flows.py
28 4 1
def __call__()
in flows.py
26 8 2
def setup()
in flows.py
25 7 1
def get()
in densities.py
24 4 2
def log_prob()
in densities.py
23 7 2
def __call__()
in flows.py
23 4 4
def __call__()
in flows.py
22 7 2
def __init__()
in main.py
21 2 2
def plot_samples()
in manifolds.py
18 1 3
def plot_density()
in manifolds.py
17 1 3
def __call__()
in flows.py
17 3 2
def sample()
in densities.py
15 1 3
def __post_init__()
in densities.py
14 3 1
def setup()
in flows.py
14 1 1
def __post_init__()
in densities.py
12 3 1