awslabs / aws-config-rules
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 1,985 units with 24,057 lines of code in units (24.0% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (133 lines of code)
    • 106 medium complex units (6,430 lines of code)
    • 165 simple units (4,148 lines of code)
    • 1,712 very simple units (13,346 lines of code)
0% | <1% | 26% | 17% | 55%
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% | <1% | 27% | 17% | 54%
PY0% | 0% | 27% | 11% | 60%
js0% | 0% | 0% | 24% | 75%
java0% | 0% | 0% | 5% | 94%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
python/IAM_USER_USED_LAST_90_DAYS0% | 31% | 0% | 8% | 59%
python/CLOUDTRAIL_ENABLED_V20% | 14% | 22% | 18% | 45%
python0% | 0% | 15% | 24% | 59%
python/EMR_KERBEROS_ENABLED0% | 0% | 44% | 14% | 40%
python/API_GW_PRIVATE_RESTRICTED0% | 0% | 35% | 9% | 54%
python/VPC_FLOW_LOGS_ENABLED_CUSTOM0% | 0% | 38% | 17% | 44%
python/SQS_TRANSIT_ENCRYPTION_CHECK0% | 0% | 39% | 10% | 50%
python/SQS_PUBLIC_ACCESS_CHECK0% | 0% | 39% | 10% | 50%
python/GUARDDUTY_UNTREATED_FINDINGS0% | 0% | 35% | 16% | 47%
python/CLOUDTRAIL_S3_DATAEVENTS_ENABLED0% | 0% | 39% | 14% | 46%
python/EBS_ENCRYPTED_VOLUMES_V20% | 0% | 28% | 24% | 46%
python/AMI_OWNERID_CHECK0% | 0% | 36% | 15% | 47%
python/EC2_SECURITY_GROUP_BADINGRESS0% | 0% | 34% | 10% | 55%
python/KMS_KEYS_TO_NOT_DELETE0% | 0% | 37% | 11% | 51%
python/API_GW_CACHE_ENABLED_AND_ENCRYPTED0% | 0% | 38% | 12% | 49%
python/EC2_TAG_MATCHES_INSTANCE_PROFILE_NAME0% | 0% | 37% | 12% | 50%
python/EC2_SECURITY_GROUP_NOT_USED0% | 0% | 30% | 11% | 57%
python/EMR_SECURITY_GROUPS_RESTRICTED0% | 0% | 22% | 20% | 57%
python/LAMBDA_DLQ_CHECK0% | 0% | 31% | 15% | 52%
python/BUSINESS_SUPPORT_OR_ABOVE_ENABLED0% | 0% | 28% | 10% | 60%
python/SECRETSMANAGER_MAX_SECRET_AGE0% | 0% | 28% | 18% | 52%
python/LAMBDA_ROLE_ALLOWED_ON_LOGGING0% | 0% | 35% | 12% | 52%
python/LAMBDA_CONCURRENCY_CHECK0% | 0% | 25% | 30% | 43%
python/IAM_IP_RESTRICTION0% | 0% | 16% | 19% | 63%
python/EMR_MASTER_NO_PUBLIC_IP0% | 0% | 25% | 28% | 46%
python/VPC_ENDPOINT_DEFAULT_POLICY0% | 0% | 23% | 22% | 54%
python/SNS_ENCRYPTED_TOPIC_CHECK0% | 0% | 26% | 23% | 50%
python/ECS_ECRIMAGE_CHECK0% | 0% | 26% | 23% | 49%
python/SQS_ENCRYPTION_CHECK0% | 0% | 26% | 22% | 51%
python/WAFV2_WEBACL_LOGGING_ENABLED0% | 0% | 26% | 21% | 52%
python/ALB_HTTP_TO_HTTPS_REDIRECTION_CHECK0% | 0% | 25% | 19% | 55%
python/API_GW_AUTHORIZER_IN_PLACE0% | 0% | 24% | 17% | 57%
python/REST_API_GW_CUSTOMDOMAIN_CHECK0% | 0% | 26% | 19% | 54%
python/ENTERPRISE_SUPPORT_PLAN_ENABLED0% | 0% | 28% | 20% | 50%
python/ECS_AWSLOGS_CHECK0% | 0% | 27% | 19% | 53%
python/SAGEMAKER_ENDPOINT_CONFIG_KMS_KEY_CONFIGURED0% | 0% | 27% | 18% | 54%
python/EFS_ENCRYPTED_CHECK0% | 0% | 28% | 18% | 53%
python/CLOUDWATCH_LOG_GROUP_ENCRYPTED0% | 0% | 28% | 18% | 52%
python/S3_PUBLIC_ACCESS_SETTINGS_FOR_ACCOUNT0% | 0% | 18% | 11% | 69%
python/SAGEMAKER_NOTEBOOK_KMS_CONFIGURED0% | 0% | 27% | 18% | 54%
python/ELASTICACHE_REDIS_CLUSTER_AUTO_BACKUP_CHECK0% | 0% | 26% | 16% | 57%
python/API_GW_EXECUTION_LOGGING_ENABLED0% | 0% | 29% | 18% | 51%
python/IAM_USER_PERMISSION_BOUNDARY_CHECK0% | 0% | 26% | 16% | 56%
python/SAGEMAKER_NOTEBOOK_NO_DIRECT_INTERNET_ACCESS0% | 0% | 28% | 17% | 53%
python/DMS_REPLICATION_NOT_PUBLIC0% | 0% | 30% | 17% | 52%
python/LAMBDA_INSIDE_VPC0% | 0% | 30% | 16% | 53%
python/RDS_ENHANCED_MONITORING_ENABLED0% | 0% | 30% | 16% | 52%
python/IAM_USER_MFA_ENABLED0% | 0% | 24% | 9% | 65%
python/ECR_REPOSITORY_SCAN_ON_PUSH_CHECK0% | 0% | 25% | 10% | 63%
python/S3_VPC_ENDPOINT_ENABLED0% | 0% | 27% | 11% | 61%
python/SNS_TOPIC_EMAIL_SUB_IN_DOMAINS0% | 0% | 27% | 11% | 61%
python/EKS_LOGGING_CHECK0% | 0% | 28% | 11% | 60%
python/EKS_PUBLIC_ACCESS0% | 0% | 28% | 11% | 60%
python/AMI_NOT_PUBLIC_CHECK0% | 0% | 28% | 11% | 60%
python/EBS_SNAPSHOT_PUBLIC_RESTORABLE_CHECK0% | 0% | 28% | 11% | 60%
python/ELASTICSEARCH_IN_VPC_ONLY0% | 0% | 28% | 11% | 59%
python/ELASTICSEARCH_ENCRYPTED_AT_REST0% | 0% | 29% | 11% | 58%
python/VPC_VPN_2_TUNNELS_UP0% | 0% | 29% | 11% | 58%
python/SHIELD_ADVANCED_ENABLED_AUTORENEW0% | 0% | 29% | 12% | 58%
python/CLOUDFRONT_WEBACL_CHECK0% | 0% | 29% | 12% | 58%
python/VPC_ENDPOINT_MANUAL_ACCEPTANCE0% | 0% | 29% | 12% | 58%
python/SHIELD_DRT_ACCESS0% | 0% | 29% | 12% | 58%
python/S3_BUCKET_NAMING_CONVENTION0% | 0% | 30% | 12% | 57%
python/IAM_USER_MATCHES_REGEX_PATTERN0% | 0% | 30% | 12% | 56%
python/ELB_DELETION_PROTECTION_ENABLED0% | 0% | 30% | 12% | 56%
python/CLOUDFRONT_VIEWER_POLICY_HTTPS0% | 0% | 31% | 12% | 56%
python/API_GW_ENDPOINT_TYPE_CHECK0% | 0% | 31% | 12% | 55%
python/EC2_INSTANCE_NO_PUBLIC_IP0% | 0% | 31% | 12% | 55%
python/' RDK parameters.json for AWS Managed Config Rules0% | 0% | 31% | 12% | 55%
python/REDSHIFT_CLUSTER_PUBLIC_ACCESS_CHECK0% | 0% | 31% | 12% | 55%
python/VPC_SG_OPEN_ONLY_TO_AUTHORIZED_PORTS0% | 0% | 22% | 25% | 51%
python/IAM_ACCESS_KEY_ROTATED0% | 0% | 25% | 26% | 47%
python/ELB_ALB_PREDEFINED_SSL_CHECK0% | 0% | 26% | 10% | 62%
python/AMI_OUTDATED_CHECK0% | 0% | 17% | 47% | 34%
python/API_GW_RESTRICTED_IP0% | 0% | 21% | 24% | 53%
python/DYNAMODB_ENCRYPTED_CUSTOM0% | 0% | 28% | 20% | 51%
python/API_GW_NOT_EDGE_OPTIMISED0% | 0% | 26% | 11% | 61%
python/IAM_ROLE_NO_POLICY_FULL_STAR0% | 0% | 23% | 20% | 56%
python/IAM_USER_NO_POLICY_FULL_STAR0% | 0% | 23% | 20% | 56%
python/IAM_GROUP_NO_POLICY_FULL_STAR0% | 0% | 23% | 20% | 56%
python/IAM_NO_USER0% | 0% | 26% | 19% | 53%
python/IAM_POLICY_REQUIRED0% | 0% | 23% | 17% | 58%
python/INTERNET_GATEWAY_AUTHORIZED_ONLY0% | 0% | 29% | 12% | 58%
python/CLOUDFRONT_LOGGING_ENABLED0% | 0% | 29% | 13% | 56%
python/INSTANCE_PROFILE_HAVE_DEFINED_POLICIES0% | 0% | 28% | 13% | 57%
python/ROOT_NO_ACCESS_KEY0% | 0% | 29% | 13% | 57%
python/LAMBDA_CODE_IS_VERSIONED0% | 0% | 24% | 22% | 53%
python-rdklib/EC2_INSTANCE_EBS_VOLUME_TAGS_MATCH0% | 0% | 0% | 62% | 37%
node0% | 0% | 0% | 24% | 75%
java/src0% | 0% | 0% | 5% | 94%
python-rdklib/SECURITYHUB_ENABLED0% | 0% | 0% | 76% | 23%
python-rdklib/AMI_DEPRECATED_CHECK0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def evaluate_compliance()
in python/CLOUDTRAIL_ENABLED_V2/CLOUDTRAIL_ENABLED_V2.py
39 32 3
def lambda_handler()
in python/IAM_USER_USED_LAST_90_DAYS/IAM_USER_USED_LAST_90_DAYS.py
94 32 2
def lambda_handler()
in python/IAM_USER_MATCHES_REGEX_PATTERN/IAM_USER_MATCHES_REGEX_PATTERN.py
69 25 2
def lambda_handler()
in python/REST_API_GW_CUSTOMDOMAIN_CHECK/REST_API_GW_CUSTOMDOMAIN_CHECK.py
69 25 2
def lambda_handler()
in python/ECS_ECRIMAGE_CHECK/ECS_ECRIMAGE_CHECK.py
69 25 2
def lambda_handler()
in python/CLOUDWATCH_LOG_GROUP_ENCRYPTED/CLOUDWATCH_LOG_GROUP_ENCRYPTED.py
69 25 2
def lambda_handler()
in python/ELB_DELETION_PROTECTION_ENABLED/ELB_DELETION_PROTECTION_ENABLED.py
69 25 2
def lambda_handler()
in python/EC2_INSTANCE_NO_PUBLIC_IP/EC2_INSTANCE_NO_PUBLIC_IP.py
69 25 2
def lambda_handler()
in python/BUSINESS_SUPPORT_OR_ABOVE_ENABLED/BUSINESS_SUPPORT_OR_ABOVE_ENABLED.py
74 25 2
def lambda_handler()
in python/S3_PUBLIC_ACCESS_SETTINGS_FOR_ACCOUNT/S3_PUBLIC_ACCESS_SETTINGS_FOR_ACCOUNT.PY
69 25 2
def lambda_handler()
in python/IAM_USER_PERMISSION_BOUNDARY_CHECK/IAM_USER_PERMISSION_BOUNDARY_CHECK.py
69 25 2
def lambda_handler()
in python/EKS_PUBLIC_ACCESS/EKS_PUBLIC_ACCESS.py
69 25 2
def lambda_handler()
in python/CLOUDTRAIL_S3_DATAEVENTS_ENABLED/CLOUDTRAIL_S3_DATAEVENTS_ENABLED.py
69 25 2
def lambda_handler()
in python/' RDK parameters.json for AWS Managed Config Rules/EC2_INSTANCE_NO_PUBLIC_IP/EC2_INSTANCE_NO_PUBLIC_IP.py
69 25 2
def lambda_handler()
in python/ENTERPRISE_SUPPORT_PLAN_ENABLED/ENTERPRISE_SUPPORT_PLAN_ENABLED.py
69 25 2
def lambda_handler()
in python/ELASTICSEARCH_IN_VPC_ONLY/ELASTICSEARCH_IN_VPC_ONLY.py
69 25 2
def lambda_handler()
in python/RDS_ENHANCED_MONITORING_ENABLED/RDS_ENHANCED_MONITORING_ENABLED.py
69 25 2
def lambda_handler()
in python/VPC_ENDPOINT_MANUAL_ACCEPTANCE/VPC_ENDPOINT_MANUAL_ACCEPTANCE.py
69 25 2
def lambda_handler()
in python/IAM_IP_RESTRICTION/IAM_IP_RESTRICTION.py
69 25 2
def lambda_handler()
in python/KMS_KEYS_TO_NOT_DELETE/KMS_KEYS_TO_NOT_DELETE.py
69 25 2