facebookresearch / svg
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 200 units with 2,375 lines of code in units (76.6% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 9 medium complex units (720 lines of code)
    • 9 simple units (255 lines of code)
    • 182 very simple units (1,400 lines of code)
0% | 0% | 30% | 10% | 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% | 0% | 30% | 10% | 58%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
svg0% | 0% | 22% | 13% | 63%
ROOT0% | 0% | 67% | 5% | 26%
svg/env0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def plot_obs_rew()
in eval-vis-model.py
71 22 7
def plot_exp()
in svg/analysis.py
92 19 11
def update()
in svg/agent.py
39 18 4
def run()
in train.py
68 18 1
def make_norm_env()
in svg/utils.py
150 17 1
def sweep_summary()
in svg/analysis.py
41 13 1
def plot_ctrl()
in eval-vis-model.py
42 13 3
48 11 6
def run_episode()
in eval-vis-model.py
169 11 3
def load_data()
in svg/replay_buffer.py
39 10 2
def log_param()
in svg/logger.py
10 8 5
26 8 4
def sweep()
in svg/sweeper.py
53 8 2
def plot_agg()
in svg/analysis.py
19 7 3
def add()
in svg/replay_buffer.py
21 7 7
def unroll()
in svg/dx.py
28 7 4
def sample_multistep()
in svg/replay_buffer.py
31 6 3
def evaluate()
in train.py
28 6 1
def log()
in svg/logger.py
9 5 6
def weight_init()
in svg/utils.py
12 5 1