aws-samples / amazon-opensearch-service-monitor
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 99 units with 1,047 lines of code in units (72.7% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 0 medium complex units (0 lines of code)
    • 6 simple units (329 lines of code)
    • 93 very simple units (718 lines of code)
0% | 0% | 0% | 31% | 68%
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% | 0% | 30% | 69%
js0% | 0% | 0% | 33% | 66%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
opensearch0% | 0% | 0% | 83% | 16%
CWLogsToOpenSearch0% | 0% | 0% | 33% | 66%
CWMetricsToOpenSearch0% | 0% | 0% | 15% | 84%
CWMetricsToOpenSearch/es_sink0% | 0% | 0% | 7% | 92%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def __init__()
in opensearch/opensearch_monitor_stack.py
196 9 4
function buildSource()
in CWLogsToOpenSearch/index.js
25 8 2
def get_single_domain_metric_values()
in CWMetricsToOpenSearch/handler.py
33 7 3
function transform()
in CWLogsToOpenSearch/index.js
47 7 1
def __init__()
in CWMetricsToOpenSearch/es_sink/es_transport.py
15 6 2
def __init__()
in CWMetricsToOpenSearch/es_sink/descriptor.py
13 6 5
def deploy()
in opensearch/setupCWSubscriptionFilter.py
17 5 1
def destroy()
in opensearch/setupCWSubscriptionFilter.py
23 5 1
def has_path()
in CWMetricsToOpenSearch/es_sink/transport_utils.py
12 5 2
def get_last_timestamp_ddb()
in CWMetricsToOpenSearch/handler.py
17 5 2
def update_metric_timestamp_ddb()
in CWMetricsToOpenSearch/handler.py
14 5 3
function post()
in CWLogsToOpenSearch/index.js
36 5 2
def flatten()
in CWMetricsToOpenSearch/es_sink/transport_utils.py
15 4 3
def valid_request_body()
in CWMetricsToOpenSearch/es_sink/transport_utils.py
8 4 1
def update_metric_timestamp()
in CWMetricsToOpenSearch/handler.py
7 4 3
def list_all_domains()
in CWMetricsToOpenSearch/handler.py
15 4 0
def print_all_vals()
in CWMetricsToOpenSearch/handler.py
12 4 1
function logFailure()
in CWLogsToOpenSearch/index.js
9 4 2
def add_log_line()
in CWMetricsToOpenSearch/es_sink/line_buffer.py
8 3 2
def flush()
in CWMetricsToOpenSearch/es_sink/flushing_buffer.py
20 3 1