aws-samples / aws-research-workshops
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 170 units with 2,456 lines of code in units (44.0% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (196 lines of code)
    • 4 medium complex units (212 lines of code)
    • 13 simple units (379 lines of code)
    • 152 very simple units (1,669 lines of code)
0% | 7% | 8% | 15% | 67%
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
js0% | 44% | 8% | 16% | 31%
py0% | 0% | 8% | 15% | 76%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
notebooks/iot_greengress0% | 16% | 3% | 11% | 69%
lib0% | 0% | 15% | 22% | 61%
notebooks/parallelcluster0% | 0% | 26% | 0% | 73%
notebooks/ml_tensorflow0% | 0% | 0% | 39% | 60%
notebooks/escience_series0% | 0% | 0% | 35% | 64%
notebooks/serverless_apps0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
SmoothieChart.prototype.render = function()
in notebooks/iot_greengress/health_tracker/tracker/ggd/flask/static/smoothie.js
196 46 2
def vpc_cleanup()
in lib/workshop.py
46 19 1
def create_before()
in notebooks/parallelcluster/pcluster_athena.py
68 16 1
60 12 1
SmoothieChart.prototype.updateValueRange = function()
in notebooks/iot_greengress/health_tracker/tracker/ggd/flask/static/smoothie.js
38 12 0
77 10 1
TimeSeries.prototype.append = function()
in notebooks/iot_greengress/health_tracker/tracker/ggd/flask/static/smoothie.js
22 10 3
def delete_job_queue()
in lib/workshop.py
36 8 1
def get_conn_info()
in notebooks/iot_greengress/health_tracker/tracker/ggd/utils.py
10 8 2
SmoothieChart.prototype.resize = function()
in notebooks/iot_greengress/health_tracker/tracker/ggd/flask/static/smoothie.js
19 8 0
def model_fn()
in notebooks/ml_tensorflow/mnist.py
50 7 4
def train()
in notebooks/escience_series/mnist.py
36 7 9
def ggc_discovery()
in notebooks/iot_greengress/health_tracker/tracker/ggd/utils.py
37 7 4
extend: function()
in notebooks/iot_greengress/health_tracker/tracker/ggd/flask/static/smoothie.js
22 7 0
def create_job_queue()
in lib/workshop.py
27 6 2
16 6 2
def upload()
in notebooks/iot_greengress/health_tracker/tracker/ggd/web.py
18 6 0
var requestAnimationFrame = function()
in notebooks/iot_greengress/health_tracker/tracker/ggd/flask/static/smoothie.js
9 6 2
27 5 1
37 5 5