microsoft / EconML
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 1,408 units with 14,640 lines of code in units (75.4% of code).
    • 2 very complex units (258 lines of code)
    • 6 complex units (607 lines of code)
    • 51 medium complex units (2,385 lines of code)
    • 96 simple units (2,149 lines of code)
    • 1,253 very simple units (9,241 lines of code)
1% | 4% | 16% | 14% | 63%
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
py1% | 4% | 15% | 15% | 63%
pyx0% | 0% | 35% | 0% | 64%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
econml/solutions21% | 0% | 23% | 16% | 38%
econml3% | 7% | 14% | 18% | 55%
econml/tree0% | 34% | 9% | 0% | 56%
econml/grf0% | 17% | 18% | 1% | 62%
econml/inference0% | 13% | 17% | 14% | 54%
econml/orf0% | 9% | 9% | 15% | 65%
econml/sklearn_extensions0% | 0% | 27% | 18% | 54%
econml/iv0% | 0% | 12% | 14% | 72%
prototypes/dml_iv0% | 0% | 17% | 9% | 73%
monte_carlo_tests0% | 0% | 40% | 0% | 59%
prototypes/dynamic_dml0% | 0% | 20% | 36% | 43%
econml/dml0% | 0% | 14% | 7% | 77%
prototypes/orthogonal_forests0% | 0% | 16% | 22% | 60%
econml/dynamic0% | 0% | 18% | 20% | 61%
econml/cate_interpreter0% | 0% | 32% | 0% | 67%
econml/policy0% | 0% | 10% | 0% | 89%
econml/data0% | 0% | 13% | 29% | 56%
econml/automated_ml0% | 0% | 10% | 19% | 69%
econml/dr0% | 0% | 0% | 16% | 83%
econml/metalearners0% | 0% | 0% | 18% | 81%
econml/_ensemble0% | 0% | 0% | 12% | 87%
econml/score0% | 0% | 0% | 0% | 100%
doc0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def fit()
in econml/solutions/causal_analysis/_causal_analysis.py
187 55 4
def einsum_sparse()
in econml/utilities.py
71 51 2
def fit()
in econml/tree/_tree_classes.py
153 48 8
def fit()
in econml/grf/_base_grf.py
127 40 7
def __getattr__()
in econml/inference/_bootstrap.py
121 34 2
def create_splits()
in econml/orf/_causal_tree.py
74 31 8
def fit()
in econml/_ortho_learner.py
86 27 15
def _crossfit()
in econml/_ortho_learner.py
46 26 4
def score()
in econml/iv/dr/_dr.py
51 25 8
def run_all_mc()
in monte_carlo_tests/monte_carlo_statsmodels.py
140 24 11
def node_replacement_text()
in econml/_tree_exporter.py
57 23 4
pyx
def __cinit__()
in econml/grf/_criterion.pyx
34 23 8
def _process_feature()
in econml/solutions/causal_analysis/_causal_analysis.py
131 22 15
def fit()
in econml/policy/_forest/_forest.py
57 21 6
def interpret()
in econml/cate_interpreter/_interpreters.py
64 20 4
def generate_coefs()
in econml/data/dynamic_panel_dgp.py
48 20 2
def summary()
in econml/iv/dml/_dml.py
62 20 5
def _cross_val_predict()
in econml/sklearn_extensions/model_selection.py
46 20 12
def summary_frame()
in econml/inference/_inference.py
50 19 7
def _check_input()
in econml/sklearn_extensions/linear_model.py
53 19 6