facebookresearch / LearningToLearn
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 136 units with 1,280 lines of code in units (61.3% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (71 lines of code)
    • 9 simple units (235 lines of code)
    • 126 very simple units (974 lines of code)
0% | 0% | 5% | 18% | 76%
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% | 5% | 18% | 76%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
mbirl/experiments0% | 0% | 76% | 0% | 23%
ml30% | 0% | 0% | 24% | 75%
ml3/envs0% | 0% | 0% | 19% | 80%
mbirl0% | 0% | 0% | 0% | 100%
ml3/experiments0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def irl_training()
in mbirl/experiments/run_model_based_irl.py
71 11 11
28 10 10
def meta_train()
in ml3/sine_regression_task.py
55 9 6
def step()
in ml3/envs/mountain_car.py
18 8 2
def sim_step_torch()
in ml3/envs/mountain_car.py
14 7 3
def sim_step()
in ml3/envs/mountain_car.py
12 7 3
def meta_train_shaped_sine()
in ml3/ml3_train.py
40 6 8
def split_to_subsets()
in ml3/mbrl_utils.py
15 6 3
def train_model()
in ml3/mbrl_utils.py
29 6 2
def __init__()
in ml3/envs/reacher_sim.py
24 6 6
22 4 10
def main()
in ml3/sine_regression_task.py
28 4 1
def reset()
in ml3/envs/bullet_sim.py
15 4 3
def sim_step()
in ml3/envs/bullet_sim.py
8 4 3
def step()
in ml3/envs/bullet_sim.py
8 4 3
def inverse_dynamics()
in ml3/envs/bullet_sim.py
11 4 2
def weight_init()
in ml3/learnable_losses.py
5 3 1
def weight_reset()
in ml3/learnable_losses.py
3 3 1
def forward()
in ml3/mbrl_utils.py
10 3 3
def forward()
in ml3/mbrl_utils.py
17 3 2