facebookresearch / starcraft_defogger
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 304 units with 3,914 lines of code in units (69.5% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (252 lines of code)
    • 12 medium complex units (959 lines of code)
    • 32 simple units (1,079 lines of code)
    • 258 very simple units (1,624 lines of code)
0% | 6% | 24% | 27% | 41%
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
cpp0% | 21% | 33% | 17% | 26%
py0% | 3% | 28% | 34% | 33%
h0% | 0% | 0% | 13% | 86%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
featurizers0% | 21% | 32% | 18% | 27%
ROOT0% | 3% | 27% | 33% | 35%
flatbuffers0% | 0% | 0% | 13% | 86%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
void FogOfWar::generateSightValues()
in featurizers/fogofwar.cpp
172 36 0
def __do_model_step()
in compare_models.py
80 30 8
void FogOfWar::revealSightAt()
in featurizers/fogofwar.cpp
81 20 6
def setup()
in utils.py
111 19 2
287 18 0
def _run_inference()
in compare_models.py
44 18 3
void CoarseConvFeaturizerStats::featurize_unit()
in featurizers/coarse_conv_featurizer_stats.cpp
42 16 4
def __init__()
in compare_models.py
41 16 3
Frame combine()
in featurizers/coarse_conv_featurizer.cpp
52 15 3
void ForwardConv2DStateActionFeaturizer::featurize_unit()
in featurizers/forward_conv2d_state_action_featurizer.cpp
88 15 4
def __init__()
in conv_lstm_models.py
93 15 16
def _do_model_step()
in compare_models.py
32 15 7
def get_featurize_fn()
in conv_lstm_utils.py
69 13 2
def __next__()
in data.py
19 12 1
vector CoarseConvFeaturizer::featurize_reduced()
in featurizers/coarse_conv_featurizer.cpp
49 10 6
def __init__()
in utils.py
104 10 1
def init()
in compare_models.py
33 10 3
def __accumulate_metrics()
in compare_models.py
110 10 6
def run_valid()
in compare_models.py
32 10 2
bool Verify()
in featurizers/coarse_conv_featurizer_units_generated.h
11 9 1