apple / ml-multiple-futures-prediction
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 41 units with 877 lines of code in units (92.3% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 6 medium complex units (381 lines of code)
    • 4 simple units (117 lines of code)
    • 31 very simple units (379 lines of code)
0% | 0% | 43% | 13% | 43%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
py0% | 0% | 43% | 13% | 43%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
multiple_futures_prediction0% | 0% | 43% | 13% | 42%
multiple_futures_prediction/cmd0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex 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 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 collate_fn()
in multiple_futures_prediction/dataset_ngsim.py
44 11 2
def __init__()
in multiple_futures_prediction/model_ngsim.py
56 9 2
def getHistory()
in multiple_futures_prediction/dataset_ngsim.py
21 7 5
def getHistory0b()
in multiple_futures_prediction/dataset_ngsim.py
16 6 4
def rbf_state_enc_get_attens()
in multiple_futures_prediction/model_ngsim.py
24 6 4
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 rbf_state_enc_hist_fwd()
in multiple_futures_prediction/model_ngsim.py
14 4 4
def get_mean()
in multiple_futures_prediction/train_ngsim.py
18 4 2
def compute_vel_theta()
in multiple_futures_prediction/dataset_ngsim.py
15 3 3
def logsumexp()
in multiple_futures_prediction/my_utils.py
9 3 3
def nll_loss_test_multimodes()
in multiple_futures_prediction/my_utils.py
30 3 5
def nll_loss_multimodes()
in multiple_futures_prediction/my_utils.py
21 3 5
def pi()
in multiple_futures_prediction/my_utils.py
14 3 2
def compute_angles()
in multiple_futures_prediction/my_utils.py
8 3 2