facebookresearch / habitat-lab
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 1,503 units with 11,484 lines of code in units (49.6% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (44 lines of code)
    • 18 medium complex units (1,086 lines of code)
    • 48 simple units (1,597 lines of code)
    • 1,436 very simple units (8,757 lines of code)
0% | <1% | 9% | 13% | 76%
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% | 9% | 13% | 76%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
habitat/datasets0% | 4% | 14% | 31% | 49%
habitat_baselines/rl0% | 0% | 24% | 11% | 64%
habitat/tasks0% | 0% | 11% | 12% | 75%
habitat_baselines/il0% | 0% | 8% | 31% | 59%
habitat/utils0% | 0% | 25% | 11% | 63%
habitat_baselines/utils0% | 0% | 18% | 8% | 73%
habitat_baselines/agents0% | 0% | 3% | 17% | 78%
habitat_baselines/slambased0% | 0% | 3% | 0% | 96%
habitat_baselines/motion_planning0% | 0% | 6% | 8% | 84%
habitat_baselines/common0% | 0% | 0% | 13% | 86%
habitat/core0% | 0% | 0% | 9% | 90%
habitat/sims0% | 0% | 0% | 0% | 100%
habitat_baselines0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
habitat/config0% | 0% | 0% | 0% | 100%
habitat_baselines/config0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def get_config_defaults()
in habitat/datasets/rearrange/rearrange_generator.py
44 31 0
def generate_single_episode()
in habitat/datasets/rearrange/rearrange_generator.py
113 22 1
def reconfigure()
in habitat/tasks/rearrange/rearrange_sim.py
80 20 2
def train()
in habitat_baselines/rl/ppo/ppo_trainer.py
126 20 1
def _init_train()
in habitat_baselines/rl/ppo/ppo_trainer.py
115 17 1
def _gen_start_pos()
in habitat/tasks/rearrange/sub_tasks/pick_task.py
51 16 3
def step()
in habitat/tasks/rearrange/grip_actions.py
31 15 5
def observations_to_image()
in habitat/utils/visualizations/utils.py
37 15 2
def __init__()
in habitat_baselines/utils/gym_adapter.py
67 15 3
def get_all_scenedataset_receptacles()
in habitat/datasets/rearrange/receptacle.py
32 14 1
def map_dataset_sample()
in habitat_baselines/il/data/nav_data.py
92 14 2
def _is_state_valid()
in habitat_baselines/motion_planning/motion_plan.py
31 13 3
def step()
in habitat/tasks/rearrange/rearrange_sim.py
48 12 3
def bresenham_supercover_line()
in habitat/utils/visualizations/fog_of_war.py
50 12 2
def _setup_actor_critic_agent()
in habitat_baselines/rl/ppo/ppo_trainer.py
56 12 2
def update_metric()
in habitat/tasks/rearrange/sub_tasks/pick_sensors.py
53 11 6
def get_coll_forces()
in habitat/tasks/rearrange/rearrange_task.py
29 11 1
def act()
in habitat_baselines/agents/slam_agents.py
41 11 3
def to_tensor()
in habitat_baselines/slambased/monodepth.py
34 11 2
def _try_register_rearrange_task()
in habitat/tasks/rearrange/__init__.py
25 10 0