aws-samples / amazon-lookout-for-metrics-samples
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 81 units with 1,527 lines of code in units (59.6% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (181 lines of code)
    • 4 medium complex units (154 lines of code)
    • 7 simple units (157 lines of code)
    • 69 very simple units (1,035 lines of code)
0% | 11% | 10% | 10% | 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
py0% | 14% | 12% | 12% | 60%
ts0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
workshops/RI2021/ml_ops/lambdas0% | 63% | 0% | 0% | 36%
next_steps/readable_alerts_html0% | 0% | 35% | 25% | 39%
getting_started0% | 0% | 6% | 10% | 83%
next_steps/kinesis_stream_connector/data_generator/src0% | 0% | 30% | 21% | 48%
next_steps/kinesis_stream_connector/l4m_detector/src0% | 0% | 30% | 21% | 48%
next_steps/readable_alerts0% | 0% | 0% | 60% | 40%
next_steps/kinesis_stream_connector/l4m_connector/stack0% | 0% | 0% | 0% | 100%
next_steps/kinesis_stream_connector/l4m_detector/stack0% | 0% | 0% | 0% | 100%
next_steps/kinesis_stream_connector/data_generator/stack0% | 0% | 0% | 0% | 100%
workshops/RI2021/ml_ops/shared0% | 0% | 0% | 0% | 100%
next_steps/kinesis_stream_connector/l4m_connector/src0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def lambda_handler()
in workshops/RI2021/ml_ops/lambdas/anomaly-alert-function/anomaly-alert-function.py
181 40 2
def lookup_anomaly_group_and_get_details()
in next_steps/readable_alerts_html/readable_alerts_html.py
54 17 3
def synthesize()
in next_steps/kinesis_stream_connector/data_generator/src/synth_live_data_csv.py
32 14 0
def synthesize()
in next_steps/kinesis_stream_connector/l4m_detector/src/synth_live_data_csv.py
32 14 0
def synthesize()
in getting_started/synth_data.py
36 13 0
def create_anomaly_string()
in next_steps/readable_alerts/readable_alerts.py
18 8 1
def create_email_contents()
in next_steps/readable_alerts_html/readable_alerts_html.py
38 7 6
def wait_delete_anomaly_detector()
in getting_started/utility.py
20 6 2
def make_tree()
in getting_started/utility.py
20 6 5
def displayable()
in getting_started/utility.py
15 6 1
def write_to_kinesis()
in next_steps/kinesis_stream_connector/data_generator/src/synth_live_data_csv.py
23 6 2
def write_to_kinesis()
in next_steps/kinesis_stream_connector/l4m_detector/src/synth_live_data_csv.py
23 6 2
def crawlerRoleCreation()
in getting_started/utility.py
149 5 1
def lambda_role()
in getting_started/utility.py
73 5 2
def L4M_role()
in getting_started/utility.py
61 5 1
def wait_anomaly_detector()
in getting_started/utility.py
18 5 2
def get()
in getting_started/synth_data.py
15 5 2
def get()
in next_steps/kinesis_stream_connector/data_generator/src/synth_live_data_csv.py
15 5 2
def get()
in next_steps/kinesis_stream_connector/l4m_detector/src/synth_live_data_csv.py
15 5 2
def get_message()
in workshops/RI2021/ml_ops/lambdas/notify-delete/notify-delete.py
11 5 1