facebookresearch / omnivore
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 54 units with 754 lines of code in units (63.4% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (128 lines of code)
    • 9 medium size units (272 lines of code)
    • 14 small units (194 lines of code)
    • 29 very small units (160 lines of code)
0% | 16% | 36% | 25% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 16% | 36% | 25% | 21%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
models0% | 19% | 35% | 25% | 19%
ROOT0% | 0% | 36% | 31% | 32%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def inflate_weights()
in models/swin_transformer_3d.py
66 17 2
def load_and_interpolate_3d_weights()
in models/swin_transformer_3d.py
62 15 2
def forward_seg()
in models/swin_transformer_3d.py
43 7 4
def forward_part1()
in models/swin_transformer_3d.py
39 8 3
def forward()
in models/swin_transformer_3d.py
33 2 3
def uniform_crop()
in transforms.py
32 11 5
def init_weights()
in models/swin_transformer_3d.py
29 11 2
def compute_mask()
in models/swin_transformer_3d.py
27 4 6
def forward()
in models/swin_transformer_3d.py
25 7 2
def __init__()
in models/swin_transformer_3d.py
23 1 8
def get_patch_embedding()
in models/swin_transformer_3d.py
21 5 2
def forward()
in models/swin_transformer_3d.py
19 5 6
def window_partition()
in models/swin_transformer_3d.py
18 1 2
def forward()
in transforms.py
15 3 2
def forward_intermediate_features()
in models/swin_transformer_3d.py
15 5 3
def __init__()
in models/swin_transformer_3d.py
14 1 6
def forward()
in models/swin_transformer_3d.py
14 4 4
def __init__()
in models/swin_transformer_3d.py
14 1 7
def window_reverse()
in models/swin_transformer_3d.py
13 1 6
def get_window_size()
in models/swin_transformer_3d.py
13 6 3