facebookresearch / rlmeta
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 352 units with 2,175 lines of code in units (76.7% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 0 medium complex units (0 lines of code)
    • 5 simple units (128 lines of code)
    • 347 very simple units (2,047 lines of code)
0% | 0% | 0% | 5% | 94%
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
cc0% | 0% | 0% | 32% | 67%
py0% | 0% | 0% | 2% | 97%
h0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
rlmeta/cc0% | 0% | 0% | 14% | 85%
rlmeta/core0% | 0% | 0% | 2% | 97%
rlmeta/envs0% | 0% | 0% | 5% | 94%
rlmeta/agents/dqn0% | 0% | 0% | 0% | 100%
rlmeta/utils0% | 0% | 0% | 0% | 100%
rlmeta/agents/ppo0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
rlmeta/agents0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def init_execution()
in rlmeta/core/loop.py
20 9 1
cc
py::tuple UnbatchNestedImpl()
in rlmeta/cc/nested_utils.cc
38 9 3
cc
void VisitNestedImpl()
in rlmeta/cc/nested_utils.cc
24 7 2
cc
py::object MapNestedImpl()
in rlmeta/cc/nested_utils.cc
29 7 2
def wrap_deepmind()
in rlmeta/envs/atari_wrappers.py
17 6 5
def run()
in setup.py
13 5 1
def _start_services()
in rlmeta/core/server.py
17 5 1
def make_replay()
in rlmeta/agents/ppo/ppo_agent.py
22 5 1
T Query()
in rlmeta/cc/segment_tree.h
20 5 2
def step()
in rlmeta/envs/atari_wrappers.py
8 5 2
def step()
in rlmeta/envs/atari_wrappers.py
14 5 2
def observation()
in rlmeta/envs/atari_wrappers.py
17 5 2
22 4 2
def __new__()
in rlmeta/core/remote.py
9 4 4
def run()
in rlmeta/core/loop.py
17 4 1
def __init__()
in rlmeta/core/loop.py
37 4 12
def _update_priority()
in rlmeta/core/replay_buffer.py
15 4 5
def train()
in rlmeta/agents/dqn/apex_dqn_agent.py
23 4 2
def make_replay()
in rlmeta/agents/dqn/apex_dqn_agent.py
24 4 1
def table()
in rlmeta/utils/stats_dict.py
13 4 2