facebookresearch / improved_vrnn
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 143 units with 3,401 lines of code in units (93.1% of code).
    • 9 very long units (1,321 lines of code)
    • 6 long units (374 lines of code)
    • 24 medium size units (688 lines of code)
    • 37 small units (609 lines of code)
    • 67 very small units (409 lines of code)
38% | 10% | 20% | 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
py38% | 10% | 20% | 17% | 12%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
models46% | 10% | 23% | 12% | 6%
ROOT26% | 13% | 12% | 26% | 21%
dataloaders0% | 0% | 21% | 41% | 37%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __init__()
in models/s2s_big_hier_128.py
203 1 8
def __init__()
in models/s2s_big_hier_v4.py
192 1 8
def __init__()
in models/s2s_big_hier.py
181 1 8
def main()
in main.py
149 47 1
def __init__()
in models/s2s_big_baseline.py
133 1 8
def __init__()
in models/vrnn_hier.py
118 10 8
def __init__()
in models/vrnn.py
118 10 8
def get_dataset()
in datasets.py
114 7 1
def __init__()
in models/s2s_convlstm_baseline.py
113 1 8
def __init__()
in models/s2s_convlstm.py
84 1 8
def main()
in sample.py
78 17 1
def prior()
in models/s2s_big_hier.py
54 12 6
def prior()
in models/s2s_big_hier_v4.py
53 11 7
53 2 0
def prior()
in models/s2s_big_hier_128.py
52 11 6
def posterior()
in models/s2s_big_hier_v4.py
46 9 5
def posterior()
in models/s2s_big_hier.py
45 9 4
def posterior()
in models/s2s_big_hier_128.py
45 9 4
def forward()
in models/s2s_convlstm.py
42 13 5
def posterior()
in models/vrnn_hier.py
41 6 4