facebookresearch / neuromorph
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 191 units with 1,299 lines of code in units (59.5% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 10 medium size units (294 lines of code)
    • 29 small units (414 lines of code)
    • 152 very small units (591 lines of code)
0% | 0% | 22% | 31% | 45%
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% | 22% | 32% | 44%
m0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
model0% | 0% | 36% | 28% | 34%
utils0% | 0% | 17% | 37% | 45%
data0% | 0% | 19% | 22% | 58%
ROOT0% | 0% | 0% | 31% | 68%
data_preprocessing/utils0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def train()
in model/interpolation_net.py
48 11 1
def compute_loss()
in model/interpolation_net.py
43 4 5
def __getitem__()
in data/data.py
35 3 2
def get_pred()
in model/interpolation_net.py
32 3 4
def interpolate()
in utils/interpolation_base.py
25 6 2
def mul_with_inv_hessian()
in utils/interpolation_base.py
23 1 1
def interpolate()
in utils/interpolation_base.py
23 5 2
def test()
in model/interpolation_net.py
23 4 3
def interpolate()
in utils/interpolation_base.py
21 4 2
def compute_neigh_hessian()
in utils/shape_utils.py
21 1 1
def forward()
in utils/interpolation_base.py
20 2 1
def train_main()
in main_train.py
19 1 0
def forward()
in utils/interpolation_base.py
17 2 1
def upsample_resolution()
in utils/interpolation_base.py
17 2 2
def detach_cpu()
in utils/shape_utils.py
17 10 1
def __init__()
in model/layers_onet.py
17 4 4
def load_self()
in model/interpolation_net.py
17 3 3
def forward()
in model/layers.py
17 1 3
def insert_additional_vertices()
in utils/interpolation_base.py
16 2 2
def insert_additional_vertices()
in utils/interpolation_base.py
16 2 2