aws-samples / amazon-opensearch-service-monitor
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 99 units with 1,047 lines of code in units (72.7% of code).
    • 1 very long units (196 lines of code)
    • 1 long units (52 lines of code)
    • 7 medium size units (210 lines of code)
    • 21 small units (293 lines of code)
    • 69 very small units (296 lines of code)
18% | 4% | 20% | 27% | 28%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py23% | 0% | 12% | 32% | 31%
js0% | 24% | 50% | 11% | 13%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
opensearch83% | 0% | 9% | 7% | 0%
CWLogsToOpenSearch0% | 24% | 50% | 11% | 13%
CWMetricsToOpenSearch0% | 0% | 38% | 46% | 15%
CWMetricsToOpenSearch/es_sink0% | 0% | 0% | 39% | 60%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __init__()
in opensearch/opensearch_monitor_stack.py
196 9 4
function buildRequest()
in CWLogsToOpenSearch/index.js
52 2 2
function transform()
in CWLogsToOpenSearch/index.js
47 7 1
function post()
in CWLogsToOpenSearch/index.js
36 5 2
def get_single_domain_metric_values()
in CWMetricsToOpenSearch/handler.py
33 7 3
function buildSource()
in CWLogsToOpenSearch/index.js
25 8 2
def destroy()
in opensearch/setupCWSubscriptionFilter.py
23 5 1
def list_domain_cloudwatch_metrics()
in CWMetricsToOpenSearch/handler.py
23 3 2
def build_metric_data_queries()
in CWMetricsToOpenSearch/handler.py
23 3 3
def _send_unsigned()
in CWMetricsToOpenSearch/es_sink/es_transport.py
20 2 4
def flush()
in CWMetricsToOpenSearch/es_sink/flushing_buffer.py
20 3 1
def deploy()
in opensearch/setupCWSubscriptionFilter.py
17 5 1
def get_last_timestamp_ddb()
in CWMetricsToOpenSearch/handler.py
17 5 2
def send_all_domain_metric_values()
in CWMetricsToOpenSearch/handler.py
16 2 1
def __init__()
in CWMetricsToOpenSearch/es_sink/es_transport.py
15 6 2
def flatten()
in CWMetricsToOpenSearch/es_sink/transport_utils.py
15 4 3
def list_all_domains()
in CWMetricsToOpenSearch/handler.py
15 4 0
def update_metric_timestamp_ddb()
in CWMetricsToOpenSearch/handler.py
14 5 3
def __init__()
in CWMetricsToOpenSearch/es_sink/descriptor.py
13 6 5
def send()
in CWMetricsToOpenSearch/es_sink/sqs_transport.py
13 1 2