facebookresearch / phyre-fwd
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,027 units with 17,263 lines of code in units (78.2% of code).
    • 0 very complex units (0 lines of code)
    • 3 complex units (560 lines of code)
    • 39 medium complex units (2,256 lines of code)
    • 140 simple units (4,403 lines of code)
    • 845 very simple units (10,044 lines of code)
0% | 3% | 13% | 25% | 58%
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% | 11% | 26% | 57%
cpp0% | 0% | 22% | 24% | 52%
js0% | 0% | 21% | 13% | 64%
h0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
agents0% | 11% | 18% | 19% | 50%
src/python0% | 0% | 9% | 29% | 60%
src/simulator0% | 0% | 20% | 21% | 57%
src/viz0% | 0% | 21% | 13% | 64%
data/task_scripts0% | 0% | 3% | 32% | 63%
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()
in agents/obj_fwd_agent.py
225 39 7
def train()
in agents/im_fwd_agent.py
210 39 7
def main()
in agents/train2.py
125 30 1
def train()
in agents/neural_agent.py
167 24 20
componentDidMount()
in src/viz/src/canvas.js
127 21 0
def construct_cmd()
in agents/launch.py
49 19 1
def compute_metrics()
in src/python/phyre/metrics.py
59 18 1
def forward()
in agents/nets.py
73 17 11
def get_task_from_id()
in src/python/phyre/viz_server/handler.py
49 17 2
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
111 17 6
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 forward()
in agents/obj_nets.py
75 15 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 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