facebookresearch / DynamicsAware
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 961 units with 17,225 lines of code in units (77.5% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (555 lines of code)
    • 36 medium complex units (1,961 lines of code)
    • 133 simple units (4,215 lines of code)
    • 790 very simple units (10,494 lines of code)
0% | 3% | 11% | 24% | 60%
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% | 3% | 9% | 26% | 61%
cpp0% | 0% | 27% | 20% | 52%
js0% | 0% | 21% | 14% | 64%
h0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
agents0% | 18% | 12% | 20% | 48%
src/python0% | 0% | 9% | 27% | 62%
src/simulator0% | 0% | 24% | 18% | 56%
src/viz0% | 0% | 21% | 14% | 64%
data/task_scripts0% | 0% | 3% | 28% | 68%
agents/report_web_viewer0% | 0% | 35% | 15% | 49%
scripts0% | 0% | 44% | 38% | 16%
scripts/offline_simulation0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def train_single_proc()
in agents/neural_agent_contrastive.py
270 50 29
def train()
in agents/neural_agent.py
285 49 26
def auccess_report()
in agents/report_web_viewer/img_browse.py
69 21 2
componentDidMount()
in src/viz/src/canvas.js
127 21 0
def segs2poly()
in src/python/phyre/virtual_tools.py
63 20 2
def get_task_from_id()
in src/python/phyre/viz_server/handler.py
54 18 2
def translate_to_phyre()
in src/python/phyre/virtual_tools.py
65 18 2
def __init__()
in agents/nets.py
88 17 10
def compute_metrics()
in src/python/phyre/metrics.py
53 17 1
def maybe_load_evaluation()
in src/python/phyre/eval_task_complexity.py
41 17 2
std::vector simulateTasksInParallel()
in src/simulator/task_utils_parallel.cpp
107 17 4
bool mergeUserInputIntoScene()
in src/simulator/image_to_box2d.cpp
58 17 7
renderStatus()
in src/viz/src/App.js
91 16 0
bool isTaskInSolvedState()
in src/simulator/task_validation.cpp
50 16 2
def load_evaluation_data()
in src/python/phyre/viz_server/handler.py
36 15 2
def main()
in src/python/phyre/eval_task_complexity.py
82 15 5
def build_command()
in agents/run_sweep_file.py
42 14 3
def main()
in scripts/check_eval_stats_solutions.py
40 14 1
def step()
in src/python/phyre/eval_task_complexity.py
45 14 1
def _update_done_stats()
in src/python/phyre/eval_task_complexity.py
32 14 3