facebookresearch / rela
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 201 units with 2,100 lines of code in units (63.2% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 2 medium complex units (83 lines of code)
    • 11 simple units (416 lines of code)
    • 188 very simple units (1,601 lines of code)
0% | 0% | 3% | 19% | 76%
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% | 8% | 19% | 71%
h0% | 0% | 0% | 22% | 77%
cc0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
pyrela0% | 0% | 12% | 28% | 59%
rela0% | 0% | 0% | 20% | 79%
atari0% | 0% | 0% | 18% | 81%
pyrela/common_utils0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def parse_log()
in pyrela/parse_log.py
61 12 2
def average_across_seed()
in pyrela/parse_log.py
22 11 1
void push()
in rela/r2d2_actor.h
44 10 3
def parse_from_root()
in pyrela/parse_log.py
27 9 4
FFTransition popTransition()
in rela/dqn_actor.h
39 8 0
SampleWeightIds sample_()
in rela/prioritized_replay.h
52 8 2
std::tuple step()
in atari/atari_env.h
33 7 1
def benchmark_fps()
in pyrela/benchmark.py
96 7 1
def max_across_seed()
in pyrela/parse_log.py
15 7 1
29 7 2
virtual void mainLoop()
in rela/thread_loop.h
26 7 0
def to_device()
in pyrela/utils.py
24 6 2
def analyze_sweep()
in pyrela/analyze_sweep.py
31 6 4
def summary()
in pyrela/common_utils/multi_counter.py
16 5 2
void checkSize()
in rela/prioritized_replay.h
16 5 3
std::tuple sample()
in rela/prioritized_replay.h
27 5 2
torch::Tensor computeFeature()
in atari/game_state.h
27 4 0
16 4 2
float aleStep()
in atari/atari_env.h
14 4 1
def __init__()
in pyrela/common_utils/logger.py
9 4 3