facebookresearch / phyre
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 868 units with 15,295 lines of code in units (77.0% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 30 medium complex units (1,708 lines of code)
    • 123 simple units (3,867 lines of code)
    • 715 very simple units (9,720 lines of code)
0% | 0% | 11% | 25% | 63%
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% | 0% | 8% | 26% | 64%
cpp0% | 0% | 22% | 24% | 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
src/python/phyre0% | 0% | 9% | 27% | 63%
src/simulator0% | 0% | 21% | 21% | 56%
src/viz/src0% | 0% | 21% | 14% | 64%
agents0% | 0% | 19% | 20% | 60%
data/task_scripts/main0% | 0% | 3% | 28% | 68%
scripts0% | 0% | 44% | 38% | 16%
src/python0% | 0% | 0% | 69% | 30%
src/simulator/utils0% | 0% | 0% | 27% | 72%
scripts/offline_simulation0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def train()
in agents/neural_agent.py
155 23 19
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 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 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
void fillConvexPoly()
in src/simulator/image_to_box2d.cpp
59 13 3
def compare()
in agents/compare.py
49 12 1
def build_task()
in data/task_scripts/main/task00013.py
52 12 2
def build_task()
in src/python/phyre/data/task_scripts/main/task00013.py
52 12 2