facebookresearch / mbrl-lib
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 403 units with 2,723 lines of code in units (45.2% 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)
    • 8 simple units (292 lines of code)
    • 395 very simple units (2,431 lines of code)
0% | 0% | 0% | 10% | 89%
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% | 0% | 10% | 89%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
mbrl/diagnostics0% | 0% | 0% | 42% | 57%
mbrl/env0% | 0% | 0% | 6% | 93%
mbrl/util0% | 0% | 0% | 2% | 97%
mbrl/models0% | 0% | 0% | 0% | 100%
mbrl/planning0% | 0% | 0% | 0% | 100%
mbrl/algorithms0% | 0% | 0% | 0% | 100%
mbrl0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def make_env_from_str()
in mbrl/util/mujoco.py
22 9 1
def selectedMatchingSequences()
in mbrl/diagnostics/training_browser.py
21 9 1
def onExperimentsSelectionChanged()
in mbrl/diagnostics/training_browser.py
48 9 3
def step()
in mbrl/env/cartpole_continuous.py
46 8 2
def run()
in mbrl/diagnostics/planet_visualizer.py
48 8 1
def plot_dataset_results()
in mbrl/diagnostics/eval_model_on_dataset.py
44 7 2
def load_experiments()
in mbrl/diagnostics/training_browser.py
26 6 1
def create_axes()
in mbrl/diagnostics/visualize_model_preds.py
37 6 1
def log_data()
in mbrl/util/logger.py
11 5 4
def _trajectory_bookkeeping()
in mbrl/util/replay_buffer.py
21 5 2
def _maybe_toggle_layers_use_only_elite()
in mbrl/models/gaussian_mlp.py
9 5 2
def _default_forward()
in mbrl/models/basic_ensemble.py
8 5 2
def _preprocess_state_np()
in mbrl/env/pets_halfcheetah.py
18 5 1
def _preprocess_state_torch()
in mbrl/env/pets_halfcheetah.py
18 5 1
def reloadExperiments()
in mbrl/diagnostics/training_browser.py
20 5 2
def headerData()
in mbrl/diagnostics/training_browser.py
8 5 4
def create_handler()
in mbrl/util/__init__.py
14 4 3
def create_handler_from_str()
in mbrl/util/__init__.py
12 4 1
def _format()
in mbrl/util/logger.py
10 4 3
def dump()
in mbrl/util/logger.py
9 4 5