apple / ml-uwac
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 651 units with 5,906 lines of code in units (64.5% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (38 lines of code)
    • 10 medium complex units (631 lines of code)
    • 28 simple units (917 lines of code)
    • 612 very simple units (4,320 lines of code)
0% | <1% | 10% | 15% | 73%
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% | <1% | 10% | 15% | 73%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
rlkit/core0% | 3% | 19% | 13% | 63%
rlkit/torch0% | 0% | 11% | 10% | 78%
rlkit/launchers0% | 0% | 19% | 33% | 46%
rlkit/envs0% | 0% | 6% | 5% | 87%
scripts0% | 0% | 60% | 0% | 39%
rlkit/data_management0% | 0% | 0% | 19% | 80%
rlkit0% | 0% | 0% | 44% | 55%
rlkit/samplers0% | 0% | 0% | 20% | 79%
rlkit/util0% | 0% | 0% | 10% | 89%
rlkit/exploration_strategies0% | 0% | 0% | 0% | 100%
rlkit/policies0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def _normalize_tabular_data()
in rlkit/core/tabulate.py
38 26 2
def generate_vae_dataset()
in rlkit/launchers/skewfit_experiments.py
137 25 1
def tabulate()
in rlkit/core/tabulate.py
30 19 7
def _format_table()
in rlkit/core/tabulate.py
25 17 5
def train_from_torch()
in rlkit/torch/sac/uwac_dropout.py
127 15 2
def get_generic_path_information()
in rlkit/core/eval_util.py
45 14 2
def _train()
in rlkit/core/batch_rl_algorithm.py
61 13 1
def sample_goals()
in rlkit/envs/vae_wrapper.py
42 13 2
def train_from_torch()
in rlkit/torch/sac/bear.py
111 13 2
def _align_column()
in rlkit/core/tabulate.py
25 12 4
def simulate_policy()
in scripts/run_goal_conditioned_policy.py
28 11 1
def _type()
in rlkit/core/tabulate.py
16 10 2
def train_vae()
in rlkit/launchers/skewfit_experiments.py
60 10 2
def get_batch()
in rlkit/torch/vae/vae_trainer.py
27 10 3
def save_itr_params()
in rlkit/core/logging.py
22 9 3
def quick_init()
in rlkit/core/serializable.py
26 9 2
def add_path()
in rlkit/data_management/obs_dict_replay_buffer.py
55 9 2
def dump_tabular()
in rlkit/core/logging.py
21 8 3
def safe_json()
in rlkit/launchers/launcher_util.py
10 8 1
def query_yes_no()
in rlkit/launchers/launcher_util.py
21 8 2