facebookresearch / OccupancyAnticipation
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 411 units with 5,005 lines of code in units (55.4% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (332 lines of code)
    • 6 medium complex units (493 lines of code)
    • 20 simple units (666 lines of code)
    • 384 very simple units (3,514 lines of code)
0% | 6% | 9% | 13% | 70%
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% | 6% | 9% | 13% | 70%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
occant_baselines/rl0% | 17% | 3% | 16% | 62%
habitat_extensions0% | 0% | 12% | 7% | 79%
occant_baselines/generate_topdown_maps0% | 0% | 33% | 0% | 66%
occant_baselines/common0% | 0% | 37% | 0% | 62%
occant_baselines/supervised0% | 0% | 37% | 12% | 49%
occant_utils0% | 0% | 0% | 32% | 67%
occant_baselines/models0% | 0% | 0% | 8% | 91%
ROOT0% | 0% | 0% | 0% | 100%
habitat_extensions/config0% | 0% | 0% | 0% | 100%
occant_baselines/config0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def train()
in occant_baselines/rl/occant_exp_trainer.py
332 38 1
def main()
in occant_baselines/generate_topdown_maps/generate_occant_gt_maps.py
98 17 1
def predict_deltas()
in occant_baselines/rl/policy.py
74 14 3
def _get_wall_occupancy()
in habitat_extensions/sensors.py
88 11 3
def _get_mesh_occupancy()
in habitat_extensions/measures.py
55 11 1
def map_update_fn()
in occant_baselines/supervised/map_update.py
87 11 1
def recurrent_generator()
in occant_baselines/common/rollout_storage.py
91 11 3
def _synchronize_configs()
in occant_baselines/rl/occant_exp_trainer.py
55 10 2
def reduce_metrics()
in occant_utils/metrics.py
20 9 2
def reduce_metrics()
in occant_utils/metrics.py
20 9 2
def main()
in occant_utils/generate_exploration_dataset.py
59 9 1
def grow_projected_map()
in occant_utils/common.py
69 9 3
def _create_gp_models()
in occant_baselines/models/occant.py
28 9 1
def worker()
in occant_baselines/rl/planner.py
23 9 6
def _prepare_batch()
in occant_baselines/rl/occant_exp_trainer.py
27 9 5
def _transform_observations()
in occant_baselines/rl/policy.py
87 9 3
def _prepare_batch()
in occant_baselines/rl/occant_nav_trainer.py
24 9 4
def _get_mesh_occupancy()
in habitat_extensions/sensors.py
51 8 3
def spatial_transform_map()
in occant_utils/common.py
27 7 4
def __init__()
in occant_baselines/models/occant.py
21 7 2