facebookresearch / hanabi_SAD
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 215 units with 2,538 lines of code in units (63.8% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 2 medium complex units (75 lines of code)
    • 16 simple units (554 lines of code)
    • 197 very simple units (1,909 lines of code)
0% | 0% | 2% | 21% | 75%
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% | 5% | 10% | 83%
h0% | 0% | 0% | 27% | 72%
cc0% | 0% | 0% | 51% | 48%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
pyhanabi0% | 0% | 5% | 16% | 78%
pyhanabi/common_utils0% | 0% | 11% | 3% | 84%
rela0% | 0% | 0% | 22% | 77%
cpp0% | 0% | 0% | 73% | 26%
pyhanabi/tools0% | 0% | 0% | 6% | 93%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def save()
in pyhanabi/common_utils/saver.py
36 14 6
def evaluate()
in pyhanabi/eval.py
39 13 10
cc
std::tuple HanabiEnv::step()
in cpp/hanabi_env.cc
50 10 1
66 10 1
void mainLoop()
in cpp/thread_loop.h
38 10 0
virtual void postAct()
in rela/r2d2_actor.h
52 10 2
def load_op_model()
in pyhanabi/utils.py
45 10 4
34 8 0
FFTransition popTransition()
in rela/transition_buffer.h
39 8 0
SampleWeightIds sample_()
in rela/prioritized_replay.h
53 8 2
def get_all_files()
in pyhanabi/common_utils/helper.py
12 8 3
def log_explore_ratio()
in pyhanabi/utils.py
32 8 2
def parse_first_dict()
in pyhanabi/utils.py
17 7 1
inline void compareShape()
in rela/tensor_dict.h
24 6 2
TensorDict get()
in rela/batcher.h
28 6 0
void push()
in rela/transition_buffer.h
31 6 3
def plot()
in pyhanabi/tools/action_matrix.py
18 6 7
def load_weight()
in pyhanabi/utils.py
15 6 3
bool terminated()
in cpp/hanabi_env.h
15 5 0
void start()
in rela/batch_runner.h
14 5 0