facebookresearch / CPA
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 79 units with 2,290 lines of code in units (86.6% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 9 medium complex units (690 lines of code)
    • 18 simple units (764 lines of code)
    • 52 very simple units (836 lines of code)
0% | 0% | 30% | 33% | 36%
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% | 33% | 36%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
compert0% | 0% | 30% | 33% | 36%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def set_hparams_()
in compert/model.py
48 21 3
def mean_plot()
in compert/plotting.py
88 19 16
def run_collect_results()
in compert/collect_results.py
64 18 3
def plot_dose_response()
in compert/plotting.py
101 15 15
def plot_embedding()
in compert/plotting.py
97 15 22
def train_compert()
in compert/train.py
55 15 2
def plot_contvar_response()
in compert/plotting.py
55 11 15
def get_best_plots()
in compert/model_selection.py
128 11 2
def get_response()
in compert/api.py
54 11 9
def __init__()
in compert/api.py
52 10 3
def get_response2D()
in compert/api.py
53 9 11
def __init__()
in compert/model.py
19 8 4
def compute_comb_emb()
in compert/api.py
45 8 2
42 8 3
def evaluate_r2()
in compert/train.py
29 8 3
def plot_latent_embeddings()
in compert/plotting.py
46 7 9
def plot_contvar_response2D()
in compert/plotting.py
62 7 6
def plot_scatter()
in compert/plotting.py
59 7 9
25 7 6
def predict()
in compert/api.py
98 7 7