facebookresearch / jps
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 289 units with 3,233 lines of code in units (75.2% of code).
    • 0 very complex units (0 lines of code)
    • 4 complex units (680 lines of code)
    • 8 medium complex units (360 lines of code)
    • 12 simple units (297 lines of code)
    • 265 very simple units (1,896 lines of code)
0% | 21% | 11% | 9% | 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
h0% | 16% | 11% | 7% | 64%
cpp0% | 100% | 0% | 0% | 0%
py0% | 0% | 36% | 32% | 31%
cc0% | 0% | 0% | 38% | 61%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
simple_game0% | 23% | 12% | 10% | 54%
rela0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
AlgResult runSearch()
in simple_game/search.h
145 40 3
ResultAgg _search2()
in simple_game/search.h
149 35 5
ResultAgg _search()
in simple_game/search.h
144 32 4
int main()
in simple_game/main.cpp
242 26 2
void step()
in simple_game/two_suited_bridge.h
43 15 1
inline tabular::Policies loadPolicy()
in simple_game/game_utils.h
79 14 2
56 14 4
void step()
in simple_game/simple_bidding.h
40 13 1
float playerReward()
in simple_game/kuhn.h
17 12 1
void step()
in simple_game/simple_hanabi.h
59 12 1
def load_policies()
in simple_game/load_strategies.py
34 11 1
std::vector legalActions()
in simple_game/simple_hanabi.h
32 11 0
35 10 1
def print_policy_table()
in simple_game/load_strategies.py
30 10 1
InfoSets sample()
in simple_game/search.h
47 9 0
rela::TensorDict feature()
in simple_game/comm2.h
15 7 0
std::string _info()
in simple_game/simple_hanabi.h
26 7 1
void purifyStrategy()
in simple_game/cfr_opt.h
18 6 0
void computeStrategy()
in simple_game/cfr_opt.h
21 6 0
std::string action2str()
in simple_game/two_suited_bridge.h
8 6 1