apple / ml-multiple-futures-prediction
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 41 units with 877 lines of code in units (92.3% of code).
    • 1 very long units (108 lines of code)
    • 3 long units (199 lines of code)
    • 10 medium size units (325 lines of code)
    • 9 small units (130 lines of code)
    • 18 very small units (115 lines of code)
12% | 22% | 37% | 14% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py12% | 22% | 37% | 14% | 13%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
multiple_futures_prediction12% | 22% | 37% | 14% | 12%
multiple_futures_prediction/cmd0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def train()
in multiple_futures_prediction/train_ngsim.py
108 23 1
def __getitem__()
in multiple_futures_prediction/dataset_ngsim.py
81 17 2
def decode()
in multiple_futures_prediction/model_ngsim.py
62 14 8
def __init__()
in multiple_futures_prediction/model_ngsim.py
56 9 2
def collate_fn()
in multiple_futures_prediction/dataset_ngsim.py
44 11 2
def forward_mfp()
in multiple_futures_prediction/model_ngsim.py
44 12 10
def eval()
in multiple_futures_prediction/train_ngsim.py
42 12 9
def __init__()
in multiple_futures_prediction/dataset_ngsim.py
36 5 12
def init_rbf_state_enc()
in multiple_futures_prediction/model_ngsim.py
33 4 2
def nll_loss_test_multimodes()
in multiple_futures_prediction/my_utils.py
30 3 5
def __init__()
in multiple_futures_prediction/train_ngsim.py
30 3 30
def rbf_state_enc_get_attens()
in multiple_futures_prediction/model_ngsim.py
24 6 4
def getHistory()
in multiple_futures_prediction/dataset_ngsim.py
21 7 5
def nll_loss_multimodes()
in multiple_futures_prediction/my_utils.py
21 3 5
def get_mean()
in multiple_futures_prediction/train_ngsim.py
18 4 2
def getHistory0b()
in multiple_futures_prediction/dataset_ngsim.py
16 6 4
def compute_vel_theta()
in multiple_futures_prediction/dataset_ngsim.py
15 3 3
def rbf_state_enc_hist_fwd()
in multiple_futures_prediction/model_ngsim.py
14 4 4
def nll_loss_test()
in multiple_futures_prediction/my_utils.py
14 1 3
def pi()
in multiple_futures_prediction/my_utils.py
14 3 2