awslabs / gluon-ts
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 3,261 units with 23,028 lines of code in units (43.0% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (398 lines of code)
    • 19 medium complex units (938 lines of code)
    • 65 simple units (2,058 lines of code)
    • 3,175 very simple units (19,634 lines of code)
0% | 1% | 4% | 8% | 85%
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% | 1% | 4% | 8% | 85%
R0% | 0% | 0% | 0% | 100%
pyi0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/gluonts/dataset0% | 10% | 3% | 7% | 78%
src/gluonts/nursery0% | 2% | 4% | 11% | 81%
src/gluonts/model0% | 0% | 5% | 8% | 85%
src/gluonts/core0% | 0% | 24% | 22% | 53%
src/gluonts/mx0% | 0% | <1% | 2% | 96%
src/gluonts0% | 0% | 10% | 5% | 84%
src/gluonts/shell0% | 0% | 0% | 20% | 79%
src/gluonts/transform0% | 0% | 0% | 11% | 88%
src/gluonts/torch0% | 0% | 0% | 7% | 92%
ROOT0% | 0% | 0% | 31% | 68%
src/gluonts/evaluation0% | 0% | 0% | 11% | 88%
src/gluonts/time_feature0% | 0% | 0% | 0% | 100%
src/gluonts/testutil0% | 0% | 0% | 0% | 100%
evaluations0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def calculate_dataset_statistics()
in src/gluonts/dataset/stat.py
215 33 1
def calculate_dataset_statistics()
in src/gluonts/nursery/SCott/pts/dataset/stat.py
183 27 1
def dump_code()
in src/gluonts/nursery/SCott/pts/core/serde.py
43 19 1
def predict()
in src/gluonts/model/predictor.py
64 16 3
def create_transformation()
in src/gluonts/model/seq2seq/_forking_estimator.py
84 15 1
def decode()
in src/gluonts/nursery/SCott/pts/core/serde.py
18 15 1
def encode()
in src/gluonts/core/serde/_base.py
47 14 1
def validated()
in src/gluonts/core/component.py
60 14 1
def validated()
in src/gluonts/nursery/SCott/pts/core/component.py
60 14 1
def make_features()
in src/gluonts/model/rotbaum/_preprocess.py
65 13 3
def _extract_instances()
in src/gluonts/nursery/SCott/pts/model/forecast_generator.py
15 13 1
def encode()
in src/gluonts/nursery/SCott/pts/core/serde.py
31 13 1
def make_timeseries()
in src/gluonts/dataset/artificial/_base.py
82 12 2
def _create_instance_splitter()
in src/gluonts/model/seq2seq/_forking_estimator.py
58 12 2
def log_binned_p()
in src/gluonts/nursery/spliced_binned_pareto/spliced_binned_pareto.py
33 12 2
def make_timeseries()
in src/gluonts/nursery/SCott/pts/dataset/artificial.py
82 12 2
def get_git_version()
in src/gluonts/_version.py
25 12 1
def _index_tensor()
in src/gluonts/mx/distribution/distribution.py
28 11 2
def _run_r_forecast()
in src/gluonts/model/r_forecast/_predictor.py
51 11 4
def from_inputs()
in src/gluonts/model/seq2seq/_mq_dnn_estimator.py
39 11 3