amazon-research / minimax-fair
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 49 units with 1,265 lines of code in units (74.3% of code).
    • 1 very complex units (338 lines of code)
    • 3 complex units (309 lines of code)
    • 5 medium complex units (242 lines of code)
    • 4 simple units (59 lines of code)
    • 36 very simple units (317 lines of code)
26% | 24% | 19% | 4% | 25%
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
py26% | 24% | 19% | 4% | 25%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src29% | 26% | 11% | 5% | 27%
ROOT0% | 0% | 100% | 0% | 0%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def do_learning()
in src/minmaxML.py
338 55 14
def do_plotting()
in src/plotting.py
109 38 19
def setup_matrices()
in src/setup_matrices.py
73 37 11
def do_pareto_plot()
in src/plot_relaxed_pareto.py
127 34 20
def generate_synthetic_data()
in src/generate_matrices.py
55 20 17
def get_dataset_features()
in dataset_mapping.py
114 17 1
def generate_feature_matrix()
in src/generate_matrices.py
11 14 7
def compute_model_errors()
in src/minmaxML.py
20 14 8
def create_validation_split()
in src/train_test_split.py
42 11 5
def determine_pareto_curve()
in src/hull_to_pareto.py
19 8 1
def generate_random_intervals()
in src/generate_matrices.py
14 7 4
def save_dataset()
in src/save_dataset.py
16 7 8
10 6 2
def save_models_to_os()
in src/save_models.py
9 5 2
9 5 5
def compute_logloss()
in src/minmaxML.py
5 5 3
def save_plots_to_os()
in src/save_plots.py
9 5 4
def read_models_from_os()
in src/save_models.py
10 4 1
def generate_column_from_distribution()
in src/generate_matrices.py
7 4 2
7 4 3