facebookresearch / mvfst-rl
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 199 units with 2,597 lines of code in units (59.2% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (51 lines of code)
    • 8 medium complex units (472 lines of code)
    • 19 simple units (564 lines of code)
    • 171 very simple units (1,510 lines of code)
0% | 1% | 18% | 21% | 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
py0% | 3% | 24% | 22% | 49%
cpp0% | 0% | 12% | 28% | 59%
h0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
scripts/plotting0% | 16% | 24% | 25% | 33%
train0% | 0% | 26% | 22% | 51%
congestion_control0% | 0% | 6% | 27% | 65%
traffic_gen0% | 0% | 14% | 0% | 85%
scripts0% | 0% | 0% | 16% | 84%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def get_hiplot_data()
in scripts/plotting/plot_sweep.py
51 36 2
std::string NetworkState::fieldToString()
in congestion_control/NetworkState.cpp
50 22 1
def learner_loop()
in train/learner.py
159 17 5
def display_hiplot()
in scripts/plotting/plot_sweep.py
26 14 5
def get_paths()
in scripts/plotting/plot_sweep.py
26 14 1
def train()
in train/train.py
72 14 1
def load_configs()
in scripts/plotting/plot_sweep.py
26 13 2
int main()
in traffic_gen/main.cpp
44 11 2
def normalize_rewards()
in train/learner.py
69 11 4
def augment()
in scripts/plotting/plot_sweep.py
31 10 4
def forward()
in train/models.py
56 10 5
def log_target()
in train/learner.py
75 10 3
def _main()
in train/learner.py
37 10 5
int aten_to_numpy_dtype()
in congestion_control/Utils.cpp
25 10 1
at::ScalarType numpy_dtype_to_aten()
in congestion_control/Utils.cpp
24 10 1
def split_schemes()
in train/pantheon_env.py
18 9 1
def make_gossip_buffer()
in train/train.py
27 8 4
void CongestionControlRPCEnv::loop()
in congestion_control/CongestionControlRPCEnv.cpp
53 8 1
def find_args_diff()
in scripts/plotting/plot_sweep.py
5 7 1
def load_metrics()
in scripts/plotting/plot_sweep.py
21 7 2