awslabs / autogluon
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,825 units with 24,416 lines of code in units (88.0% of code).
    • 3 very complex units (687 lines of code)
    • 24 complex units (2,288 lines of code)
    • 141 medium complex units (6,777 lines of code)
    • 209 simple units (4,681 lines of code)
    • 1,448 very simple units (9,983 lines of code)
2% | 9% | 27% | 19% | 40%
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
py2% | 9% | 27% | 19% | 40%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
text/src14% | 6% | 33% | 18% | 28%
vision/src11% | 20% | 37% | 17% | 12%
tabular/src1% | 10% | 25% | 17% | 44%
core/src0% | 7% | 31% | 18% | 42%
common/src0% | 16% | 10% | 28% | 45%
features/src0% | 0% | 17% | 30% | 51%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def train_function()
in text/src/autogluon/text/text_prediction/mx/models.py
361 72 21
def early_stopping_custom()
in tabular/src/autogluon/tabular/models/lgb/callbacks.py
154 58 11
def fit()
in vision/src/autogluon/vision/predictor/predictor.py
172 55 7
def train_net()
in tabular/src/autogluon/tabular/models/tabular_nn/mxnet/tabular_nn_mxnet.py
152 48 8
def distill()
in core/src/autogluon/core/trainer/abstract_trainer.py
136 45 17
def _train_image_classification()
in vision/src/autogluon/vision/_gluoncv/image_classification.py
114 41 2
def _train_net()
in tabular/src/autogluon/tabular/models/tabular_nn/torch/tabular_nn_torch.py
143 38 10
def __init__()
in tabular/src/autogluon/tabular/models/tabular_nn/torch/torch_network_modules.py
96 38 8
def get_features()
in common/src/autogluon/common/features/feature_metadata.py
43 37 10
def construct_custom_catboost_metric()
in tabular/src/autogluon/tabular/models/catboost/catboost_utils.py
35 36 4
def _train_and_save()
in core/src/autogluon/core/trainer/abstract_trainer.py
88 33 9
def pac_score()
in core/src/autogluon/core/metrics/classification_metrics.py
103 32 2
def fit()
in text/src/autogluon/text/text_prediction/predictor/predictor.py
155 31 14
def general_data_processing()
in tabular/src/autogluon/tabular/learner/default_learner.py
90 30 6
def fit()
in tabular/src/autogluon/tabular/predictor/predictor.py
112 30 8
def evaluate_predictions()
in tabular/src/autogluon/tabular/learner/abstract_learner.py
114 29 6
def transform()
in tabular/src/autogluon/tabular/models/tabular_nn/utils/categorical_encoders.py
47 29 2
def _load()
in core/src/autogluon/core/utils/serialization.py
153 29 4
def mousover_plot()
in core/src/autogluon/core/utils/plots.py
78 29 12
def auto_suggest()
in vision/src/autogluon/vision/_gluoncv/utils.py
106 29 3