facebookresearch / adversarially-motivated-intrinsic-goals
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 64 units with 912 lines of code in units (63.6% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 2 medium complex units (261 lines of code)
    • 6 simple units (223 lines of code)
    • 56 very simple units (428 lines of code)
0% | 0% | 28% | 24% | 46%
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% | 28% | 24% | 46%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
monobeast/minigrid0% | 0% | 42% | 22% | 35%
torchbeast/core0% | 0% | 0% | 29% | 70%
ROOT0% | 0% | 0% | 28% | 71%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def train()
in monobeast/minigrid/monobeast_amigo.py
172 25 1
def act()
in monobeast/minigrid/monobeast_amigo.py
89 20 8
def get_batch()
in monobeast/minigrid/monobeast_amigo.py
28 9 7
def forward()
in monobeast/minigrid/monobeast_amigo.py
57 9 3
def log()
in torchbeast/core/file_writer.py
23 8 4
def gather_metadata()
in torchbeast/core/file_writer.py
29 7 0
def step()
in env_utils.py
35 6 2
def __init__()
in monobeast/minigrid/monobeast_amigo.py
51 6 6
def reached_goal_func()
in monobeast/minigrid/monobeast_amigo.py
17 4 4
def create_buffers()
in monobeast/minigrid/monobeast_amigo.py
25 4 6
def create_embeddings()
in monobeast/minigrid/monobeast_amigo.py
9 4 3
def forward()
in monobeast/minigrid/monobeast_amigo.py
31 4 2
def create_embeddings()
in monobeast/minigrid/monobeast_amigo.py
9 4 3
def initial()
in env_utils.py
22 3 1
def _select()
in monobeast/minigrid/monobeast_amigo.py
6 3 3
def __init__()
in monobeast/minigrid/monobeast_amigo.py
48 3 7
def initial_state()
in monobeast/minigrid/monobeast_amigo.py
4 3 2
def _select()
in monobeast/minigrid/monobeast_amigo.py
6 3 3
def stds()
in torchbeast/core/prof.py
2 2 1
def summary()
in torchbeast/core/prof.py
14 2 2