facebookresearch / Kats
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 996 units with 8,329 lines of code in units (42.2% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 15 medium complex units (589 lines of code)
    • 50 simple units (1,353 lines of code)
    • 931 very simple units (6,387 lines of code)
0% | 0% | 7% | 16% | 76%
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% | 7% | 16% | 76%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
kats/detectors0% | 0% | 9% | 15% | 75%
kats/models0% | 0% | 4% | 21% | 73%
kats/utils0% | 0% | 8% | 3% | 87%
kats0% | 0% | 21% | 12% | 66%
kats/tsfeatures0% | 0% | 0% | 0% | 100%
kats/evaluation0% | 0% | 0% | 0% | 100%
kats/data0% | 0% | 0% | 0% | 100%
kats/graphics0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def detector()
in kats/detectors/cusum_detection.py
75 16 2
def __init__()
in kats/detectors/bocpd.py
40 16 3
def __eq__()
in kats/detectors/cusum_model.py
20 16 2
def _perform_op()
in kats/consts.py
41 15 3
def predict()
in kats/models/ensemble/kats_ensemble.py
39 13 2
def __eq__()
in kats/consts.py
27 13 2
def _valid_frequency()
in kats/detectors/hourly_ratio_detection.py
35 13 1
def calc_error()
in kats/utils/backtesters.py
36 12 1
def _validate_data()
in kats/models/metalearner/get_metadata.py
13 12 1
def fit()
in kats/models/prophet.py
77 12 2
def _find_posterior()
in kats/detectors/bocpd.py
47 12 3
def evaluate_arm()
in kats/utils/time_series_parameter_tuning.py
33 11 2
def fit()
in kats/utils/cupik.py
23 11 5
def save_model()
in kats/models/globalmodel/ensemble.py
48 11 2
def _ttest_multivariate()
in kats/detectors/detector_consts.py
35 11 1
def _predict_origin()
in kats/models/reconciliation/thm.py
34 10 3
def feature_extraction()
in kats/models/nowcasting/dynamic_nowcasting.py
53 10 1
def build_rnn()
in kats/models/globalmodel/model.py
34 10 1
def forward()
in kats/models/globalmodel/utils.py
58 10 2
def detector_()
in kats/detectors/cusum_detection.py
45 10 2