facebookresearch / InvarianceUnitTests
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 40 units with 650 lines of code in units (75.1% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (77 lines of code)
    • 8 simple units (288 lines of code)
    • 31 very simple units (285 lines of code)
0% | 0% | 11% | 44% | 43%
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% | 11% | 44% | 43%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
scripts0% | 0% | 11% | 44% | 43%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def build_table()
in scripts/collect_results.py
77 17 6
def fit()
in scripts/models.py
19 8 4
def run_experiment()
in scripts/main.py
46 8 1
def plot_table()
in scripts/plot_results.py
43 8 6
def __init__()
in scripts/models.py
23 7 5
def fit()
in scripts/models.py
25 7 4
def plot_table_avg()
in scripts/plot_results.py
41 7 6
def plot_nenvs_dimspu()
in scripts/plot_results.py
62 7 6
def print_table()
in scripts/collect_results.py
29 6 3
def fit()
in scripts/models.py
9 5 4
def __init__()
in scripts/datasets.py
17 5 4
def __init__()
in scripts/datasets.py
26 5 4
def compute_errors()
in scripts/utils.py
8 5 2
def fit()
in scripts/models.py
12 4 4
def mask_step()
in scripts/models.py
16 4 6
def print_row()
in scripts/collect_results.py
4 4 3
def build_df()
in scripts/plot_results.py
24 4 1
def process_results()
in scripts/plot_results.py
27 4 3
def find_parameters()
in scripts/models.py
9 3 2
def print_table_hparams()
in scripts/collect_results.py
7 3 3