facebookresearch / level-replay
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 167 units with 1,595 lines of code in units (73.3% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (179 lines of code)
    • 2 medium complex units (81 lines of code)
    • 9 simple units (265 lines of code)
    • 155 very simple units (1,070 lines of code)
0% | 11% | 5% | 16% | 67%
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% | 11% | 5% | 16% | 67%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT0% | 58% | 18% | 20% | 1%
level_replay0% | 0% | 2% | 17% | 79%
custom_envs0% | 0% | 0% | 7% | 92%
level_replay/algo0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def train()
in train.py
179 36 2
def sample()
in level_replay/level_sampler.py
24 11 2
def evaluate()
in test.py
57 11 11
63 10 9
def _update_with_rollouts()
in level_replay/level_sampler.py
39 9 3
def update_with_rollouts()
in level_replay/level_sampler.py
18 8 2
def _score_transform()
in level_replay/level_sampler.py
24 8 4
def gather_metadata()
in level_replay/file_writer.py
33 8 0
def log()
in level_replay/file_writer.py
23 8 4
def make_lr_venv()
in level_replay/envs.py
41 6 5
def apply_init_()
in level_replay/model.py
10 6 1
def add_door()
in custom_envs/obstructedmaze_fixedgrid.py
14 6 8
def reset()
in level_replay/envs.py
15 5 1
def __init__()
in level_replay/envs.py
7 5 4
def reset()
in level_replay/envs.py
15 5 1
def after_update()
in level_replay/level_sampler.py
7 5 1
def __init__()
in level_replay/model.py
13 5 5
def __init__()
in level_replay/model.py
11 5 4
def step_async()
in level_replay/envs.py
5 4 2
def step_wait()
in level_replay/envs.py
12 4 1