facebookresearch / interaction-exploration
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 291 units with 3,018 lines of code in units (75.5% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (86 lines of code)
    • 11 medium complex units (742 lines of code)
    • 16 simple units (334 lines of code)
    • 262 very simple units (1,856 lines of code)
0% | 2% | 24% | 11% | 61%
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% | 2% | 24% | 11% | 61%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
envs0% | 13% | 13% | 8% | 64%
rl/ppo0% | 0% | 59% | 0% | 40%
interaction_exploration0% | 0% | 47% | 0% | 52%
affordance_seg0% | 0% | 23% | 16% | 60%
interaction_exploration/tools0% | 0% | 52% | 27% | 19%
rl/common0% | 0% | 9% | 22% | 68%
ROOT0% | 0% | 0% | 32% | 67%
interaction_exploration/utils0% | 0% | 0% | 5% | 94%
rl/models0% | 0% | 0% | 0% | 100%
interaction_exploration/models0% | 0% | 0% | 0% | 100%
interaction_exploration/config0% | 0% | 0% | 0% | 100%
rl/config0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def compute_masks()
in envs/thor_beacons.py
49 33 3
def compute_masks()
in envs/thor_beacons.py
37 27 3
def train()
in rl/ppo/ppo_trainer.py
117 24 1
def eval()
in rl/ppo/ppo_trainer.py
144 23 1
def enjoy()
in interaction_exploration/viz_trainer.py
131 20 1
def construct_envs()
in rl/common/env_utils.py
38 18 2
def get_target_obj()
in envs/thor.py
28 17 3
def update_beacon_coordinates()
in envs/thor_beacons.py
40 17 2
def collect_affordance_episodes()
in affordance_seg/collect_dset.py
123 15 1
def compute_graph()
in interaction_exploration/tools/calculate_max_interactions.py
44 14 1
def run()
in interaction_exploration/tools/calculate_max_interactions.py
36 12 3
def step()
in envs/thor_beacons.py
18 11 2
def init_environment()
in interaction_exploration/tools/calculate_max_interactions.py
23 11 1
def step()
in envs/thor_beacons.py
11 10 2
def populate_dset()
in affordance_seg/dataset.py
23 10 3
def get_beacon_position()
in envs/thor_beacons.py
23 9 3
def parse_episodes()
in interaction_exploration/tools/plot_results.py
15 9 3
18 8 1
def init_environment()
in envs/thor.py
12 8 1
def close()
in rl/common/vector_env.py
15 8 1