facebookresearch / meshtalk
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 39 units with 409 lines of code in units (1.6% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 4 medium size units (103 lines of code)
    • 11 small units (165 lines of code)
    • 24 very small units (141 lines of code)
0% | 0% | 25% | 40% | 34%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 25% | 40% | 34%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
utils0% | 0% | 43% | 22% | 34%
models0% | 0% | 17% | 48% | 34%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def render()
in utils/renderer.py
32 1 2
def forward_inference()
in models/context_model.py
26 7 5
def to_video()
in utils/renderer.py
23 3 6
def __init__()
in models/vertex_unet.py
22 3 7
def __init__()
in models/encoders.py
18 2 3
def forward()
in models/encoders.py
18 4 2
def smooth_geom()
in utils/helpers.py
17 2 4
def __init__()
in models/context_model.py
17 3 7
def sample()
in models/context_model.py
17 5 3
def __init__()
in models/context_model.py
14 1 5
def __init__()
in models/encoders.py
14 1 9
def forward()
in models/context_model.py
13 3 3
def __init__()
in models/encoders.py
13 3 6
def __init__()
in models/encoders.py
13 1 6
def load()
in utils/helpers.py
11 2 3
def __init__()
in utils/renderer.py
10 2 2
def _forward_inference()
in models/context_model.py
10 2 5
def forward()
in models/context_model.py
10 2 3
def save()
in utils/helpers.py
9 2 3
def forward()
in models/vertex_unet.py
9 1 3