facebookresearch / RidgeSketch
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 218 units with 2,840 lines of code in units (56.1% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 8 medium complex units (402 lines of code)
    • 21 simple units (427 lines of code)
    • 189 very simple units (2,011 lines of code)
0% | 0% | 14% | 15% | 70%
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% | 14% | 15% | 70%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT0% | 0% | 20% | 26% | 52%
benchmarks0% | 0% | 30% | 15% | 53%
experiments0% | 0% | 7% | 9% | 82%
datasets0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
61 22 5
def run()
in benchmarks/run_benchmarks.py
75 20 3
def filter_sketch_sizes()
in experiments/momentum_regimes.py
55 13 2
def filter_sketch_sizes()
in experiments/regularization_on_momentum.py
55 13 2
50 12 5
def fit()
in ridge_sketch.py
38 11 3
def __init__()
in benchmarks/run_benchmarks.py
46 11 3
def pad_with_zeros()
in sparse_tools.py
22 11 3
def set_momentum()
in ridge_sketch.py
19 10 4
def sketch()
in sketching.py
20 10 2
def fwht()
in srht.py
21 9 1
def sketch_solver()
in ridge_sketch.py
33 8 3
def plot_residuals()
in experiments/different_sketches.py
31 8 3
def plot_residuals()
in experiments/compare_conjugate_gradient.py
31 8 3
def get_config_combinations()
in benchmarks/run_benchmarks.py
49 8 1
def set_solver()
in ridge_sketch.py
12 7 3
def format_run_names_exp()
in experiments/momentum_regimes.py
13 7 3
def format_run_names_exp()
in experiments/different_sketch_sizes_time_bar_plots.py
13 7 3
def format_run_names()
in benchmarks/run_benchmarks.py
8 7 3
def update_iterate()
in sketching.py
13 7 4