aws-samples / aws-cdk-managed-elkk
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 39 units with 500 lines of code in units (30.9% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (156 lines of code)
    • 3 medium size units (99 lines of code)
    • 6 small units (83 lines of code)
    • 28 very small units (162 lines of code)
0% | 31% | 19% | 16% | 32%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 31% | 19% | 16% | 32%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
filebeat0% | 90% | 0% | 0% | 9%
helpers0% | 32% | 25% | 16% | 25%
athena0% | 0% | 95% | 0% | 4%
kibana0% | 0% | 0% | 43% | 56%
vpc0% | 0% | 0% | 0% | 100%
logstash0% | 0% | 0% | 0% | 100%
elastic0% | 0% | 0% | 0% | 100%
kafka0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in filebeat/log_generator.py
82 14 0
def main()
in helpers/lambda_env_update.py
74 4 2
def __init__()
in athena/athena_stack.py
42 2 4
def update_kafka_configuration()
in helpers/functions.py
35 11 1
def main()
in helpers/s3_bucket_empty.py
22 4 2
def redirect_to_object()
in kibana/lambda_function.py
16 1 3
def lambda_handler()
in kibana/lambda_function.py
15 16 2
def generate_url()
in kibana/lambda_function.py
14 5 1
def ensure_service_linked_role()
in helpers/functions.py
13 4 1
def kafka_get_brokers()
in helpers/functions.py
13 3 0
def instance_add_log_permissions()
in helpers/functions.py
12 2 1
def kafka_get_arn()
in helpers/functions.py
10 4 0
def elastic_get_domain()
in helpers/functions.py
10 4 0
def user_data_init()
in helpers/functions.py
10 1 1
def clean_body()
in kibana/lambda_function.py
9 3 1
def error_response()
in kibana/lambda_function.py
9 1 0
def file_updated()
in helpers/functions.py
9 3 2
def get_log_group_arn()
in helpers/functions.py
9 4 1
def __init__()
in kibana/kibana_stack.py
8 1 0
def proxied_request()
in kibana/lambda_function.py
8 1 3