facebookresearch / MTRF
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 857 units with 10,772 lines of code in units (68.7% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 23 medium complex units (1,646 lines of code)
    • 80 simple units (2,813 lines of code)
    • 754 very simple units (6,313 lines of code)
0% | 0% | 15% | 26% | 58%
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% | 15% | 26% | 58%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
MTRF/algorithms/softlearning/algorithms0% | 0% | 22% | 40% | 36%
MTRF/r3l/r3l/r3l_envs0% | 0% | 18% | 17% | 64%
MTRF/algorithms/softlearning/environments0% | 0% | 25% | 13% | 60%
MTRF/r3l/r3l/r3l_agents0% | 0% | 31% | 37% | 30%
MTRF/algorithms/softlearning/samplers0% | 0% | 22% | 11% | 65%
MTRF/algorithms/softlearning/models0% | 0% | 12% | 32% | 54%
MTRF/algorithms/softlearning/preprocessors0% | 0% | 7% | 9% | 82%
MTRF/r3l/r3l/utils0% | 0% | 7% | 10% | 82%
MTRF/algorithms/softlearning/replay_pools0% | 0% | 0% | 29% | 70%
MTRF/r3l/r3l/robot0% | 0% | 0% | 22% | 77%
MTRF/algorithms/softlearning/policies0% | 0% | 0% | 39% | 60%
MTRF/algorithms/scripts0% | 0% | 0% | 32% | 67%
MTRF/algorithms/softlearning/value_functions0% | 0% | 0% | 64% | 35%
MTRF/algorithms/softlearning/rnd0% | 0% | 0% | 100% | 0%
MTRF/r3l/r3l/sawyer_hardware0% | 0% | 0% | 41% | 58%
MTRF/algorithms/softlearning/misc0% | 0% | 0% | 5% | 94%
MTRF/algorithms/softlearning/distributions0% | 0% | 0% | 0% | 100%
MTRF/algorithms/softlearning/scripts0% | 0% | 0% | 0% | 100%
MTRF/algorithms/softlearning/utils0% | 0% | 0% | 0% | 100%
MTRF/r3l/r3l0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def do_evals()
in MTRF/r3l/r3l/r3l_agents/softlearning/evaluation_scripts/phased_evals_midair.py
67 24 2
def _train()
in MTRF/algorithms/softlearning/algorithms/multi_sac.py
105 21 1
def __init__()
in MTRF/algorithms/softlearning/environments/adapters/gym_adapter.py
68 20 7
def get_diagnostics()
in MTRF/algorithms/softlearning/algorithms/multi_sac.py
112 19 5
def task_graph()
in MTRF/r3l/r3l/r3l_envs/inhand_env/bulb.py
62 19 1
def rollout()
in MTRF/algorithms/softlearning/samplers/utils.py
77 18 10
def _train()
in MTRF/algorithms/softlearning/algorithms/rl_algorithm.py
91 17 1
def _init_diagnostics_ops()
in MTRF/algorithms/softlearning/algorithms/multi_sac.py
53 17 1
def _reset()
in MTRF/r3l/r3l/r3l_envs/inhand_env/multi_phase.py
40 17 1
def reset_model()
in MTRF/algorithms/softlearning/environments/gym/mujoco/pusher_2d.py
89 16 1
def get_obs_dict()
in MTRF/r3l/r3l/r3l_envs/inhand_env/base.py
139 15 1
def __init__()
in MTRF/algorithms/softlearning/environments/gym/wrappers/pixel_observation.py
62 14 7
def _train()
in MTRF/algorithms/softlearning/algorithms/phased_sac.py
134 14 1
def _evaluation_paths()
in MTRF/algorithms/softlearning/algorithms/phased_sac.py
39 14 1
def sample()
in MTRF/algorithms/softlearning/samplers/simple_sampler.py
57 14 1
def main()
in MTRF/r3l/r3l/r3l_agents/examine_random_policy.py
64 14 0
def task_graph()
in MTRF/r3l/r3l/r3l_envs/inhand_env/basket.py
41 13 1
def do_evals()
in MTRF/r3l/r3l/r3l_agents/softlearning/evaluation_scripts/video_collection_flipup_evals.py
71 12 4
def do_evals()
in MTRF/r3l/r3l/r3l_agents/softlearning/evaluation_scripts/phased_evals_midair_slotted.py
62 12 2
def convnet()
in MTRF/algorithms/softlearning/preprocessors/convnet_preprocessor.py
50 11 5