aws-samples / simple-forecast-solution
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 112 units with 2,709 lines of code in units (73.1% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (26 lines of code)
    • 11 simple units (412 lines of code)
    • 100 very simple units (2,271 lines of code)
0% | 0% | <1% | 15% | 83%
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% | <1% | 15% | 83%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
afa0% | 0% | 3% | 33% | 63%
afa/app0% | 0% | 0% | 23% | 76%
cdk/cdk0% | 0% | 0% | 0% | 100%
cdk/cdk/afc_lambdas0% | 0% | 0% | 0% | 100%
cdk/cdk/afc_lambdas/postprocess0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
26 11 2
def run_cv_select()
in afa/core.py
58 10 7
def forecaster()
in afa/core.py
37 9 1
def run_pipeline()
in afa/core.py
34 9 8
def exsmooth()
in afa/core.py
14 7 3
def run_cv()
in afa/core.py
37 7 8
def load_data()
in afa/core.py
30 7 2
35 6 2
def panel_launch()
in afa/app/app.py
16 6 0
def panel_accuracy()
in afa/app/app.py
26 6 0
70 6 0
55 6 0
def holt()
in afa/core.py
17 5 3
def make_df_top()
in afa/app/app.py
54 5 7
def make_ml_df_top()
in afa/app/app.py
49 5 7
def panel_downloads()
in afa/app/app.py
10 5 0
14 5 0
def _lag_view()
in afa/core.py
6 4 3
def calc_metrics()
in afa/core.py
21 4 3
def calc_smape()
in afa/core.py
15 4 4