awslabs / aws-cloudfront-extensions
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 153 units with 6,414 lines of code in units (60.8% of code).
    • 1 very complex units (206 lines of code)
    • 1 complex units (67 lines of code)
    • 9 medium complex units (578 lines of code)
    • 28 simple units (1,016 lines of code)
    • 114 very simple units (4,547 lines of code)
3% | 1% | 9% | 15% | 70%
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
py5% | 1% | 15% | 29% | 47%
js0% | 0% | 10% | 0% | 89%
ts0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
templates/aws-cloudfront-waf6% | 1% | 9% | 15% | 67%
templates/aws-cloudfront-monitoring0% | 0% | 10% | 14% | 75%
edge/nodejs0% | 0% | 10% | 0% | 89%
edge/python0% | 0% | 0% | 39% | 60%
scripts/python0% | 0% | 0% | 38% | 61%
util/update-lambda-function0% | 0% | 0% | 55% | 44%
util/update-auth-cognito-function0% | 0% | 0% | 0% | 100%
templates/workshop-demo0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def lambda_handler()
in templates/aws-cloudfront-waf/source/custom_resource/custom-resource.py
206 64 2
def lambda_handler()
in templates/aws-cloudfront-waf/source/helper/helper.py
67 29 2
def send_anonymous_usage_data()
in templates/aws-cloudfront-waf/source/reputation_lists_parser/reputation-lists.py
130 14 2
def send_anonymous_usage_data()
in templates/aws-cloudfront-waf/source/access_handler/access-handler.py
124 14 6
def count_by_speed()
in templates/aws-cloudfront-monitoring/source/lambda.d/metric_collector_download_speed_origin/metric_collector_download_speed_origin.py
19 14 2
def count_by_speed()
in templates/aws-cloudfront-monitoring/source/lambda.d/metric_collector_download_speed_cdn/metric_collector_download_speed_cdn.py
19 14 2
def check_app_log_bucket()
in templates/aws-cloudfront-waf/source/helper/helper.py
29 13 3
def check_service_dependencies()
in templates/aws-cloudfront-waf/source/helper/helper.py
40 13 2
def gen_detailed_by_interval()
in templates/aws-cloudfront-monitoring/source/lambda.d/metric_collector_download_speed_origin/metric_collector_download_speed_origin.py
96 12 4
def gen_detailed_by_interval()
in templates/aws-cloudfront-monitoring/source/lambda.d/metric_collector_download_speed_cdn/metric_collector_download_speed_cdn.py
97 12 4
function matchWildCard()
in edge/nodejs/anti-hotlinking/anti-hotlinking/app.js
24 12 2
def add_s3_bucket_lambda_event()
in templates/aws-cloudfront-waf/source/custom_resource/custom-resource.py
44 10 6
def lambda_handler()
in templates/aws-cloudfront-waf/source/log_parser/add_athena_partitions.py
36 10 2
def remove_s3_bucket_lambda_event()
in templates/aws-cloudfront-waf/source/custom_resource/custom-resource.py
31 9 4
def construct_query_string()
in templates/aws-cloudfront-monitoring/source/lambda.d/shared_lib/python/metric_helper.py
82 9 6
def lambda_handler()
in templates/aws-cloudfront-waf/source/reputation_lists_parser/reputation-lists.py
60 8 2
def check_requirements()
in templates/aws-cloudfront-waf/source/helper/helper.py
12 8 2
def lambda_handler()
in templates/aws-cloudfront-waf/source/log_parser/partition_s3_logs.py
40 8 2
def lambda_handler()
in templates/aws-cloudfront-monitoring/source/lambda.d/metric_collector_download_speed_origin/metric_collector_download_speed_origin.py
42 8 2
def lambda_handler()
in templates/aws-cloudfront-monitoring/source/lambda.d/metric_collector_download_speed_cdn/metric_collector_download_speed_cdn.py
42 8 2