facebookresearch / rebel
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 246 units with 3,218 lines of code in units (69.2% of code).
    • 1 very complex units (290 lines of code)
    • 1 complex units (221 lines of code)
    • 6 medium complex units (470 lines of code)
    • 15 simple units (488 lines of code)
    • 223 very simple units (1,749 lines of code)
9% | 6% | 14% | 15% | 54%
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
py29% | 0% | 11% | 9% | 49%
cc0% | 13% | 21% | 18% | 46%
h0% | 0% | 0% | 16% | 83%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
cfvpy42% | 0% | 10% | 9% | 36%
csrc/liars_dice0% | 13% | 21% | 17% | 47%
heyhi0% | 0% | 20% | 14% | 65%
csrc/liars_dice/rela0% | 0% | 0% | 17% | 82%
scripts0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def run_trainer()
in cfvpy/selfplay.py
290 70 1
cc
int main()
in csrc/liars_dice/recursive_eval.cc
221 41 2
cc
void step()
in csrc/liars_dice/subgame_solving.cc
82 20 1
cc
float eval_net()
in csrc/liars_dice/stats.cc
101 20 8
cc
TreeStrategyStats compute_stategy_stats()
in csrc/liars_dice/subgame_solving.cc
73 15 2
cc
int main()
in csrc/liars_dice/gen_benchmark.cc
98 15 2
def initialize_datagen()
in cfvpy/selfplay.py
72 11 1
def _build_slurm_executor()
in heyhi/__init__.py
44 11 2
cc
void compute_strategy_recursive_to_leaf()
in csrc/liars_dice/recursive_solving.cc
50 10 7
cc
void step()
in csrc/liars_dice/subgame_solving.cc
40 10 1
cc
void update_regrets()
in csrc/liars_dice/subgame_solving.cc
36 10 1
SampleWeightIds sample_with_priorities_()
in csrc/liars_dice/rela/prioritized_replay.h
56 10 2
29 9 3
def kill_and_prune()
in heyhi/__init__.py
19 9 2
cc
void RlRunner::sample_state_to_leaf()
in csrc/liars_dice/recursive_solving.cc
45 8 1
cc
std::vector compute_ev()
in csrc/liars_dice/subgame_solving.cc
39 8 3
cc
void report_regrets()
in csrc/liars_dice/recursive_eval.cc
26 7 5
cc
TreeStrategy get_uniform_reach_weigted_strategy()
in csrc/liars_dice/subgame_solving.cc
25 7 3
cc
void update_sum_strat()
in csrc/liars_dice/subgame_solving.cc
30 7 4
def __init__()
in cfvpy/selfplay.py
38 7 2