awslabs / aws-config-rules
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 1,985 units with 24,057 lines of code in units (24.0% of code).
    • 0 very long units (0 lines of code)
    • 89 long units (6,037 lines of code)
    • 159 medium size units (4,481 lines of code)
    • 426 small units (5,842 lines of code)
    • 1,311 very small units (7,697 lines of code)
0% | 25% | 18% | 24% | 31%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 25% | 18% | 24% | 31%
PY0% | 27% | 11% | 29% | 31%
js0% | 0% | 55% | 7% | 36%
java0% | 0% | 0% | 21% | 78%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
python/AMI_OUTDATED_CHECK0% | 57% | 7% | 14% | 19%
python/EMR_KERBEROS_ENABLED0% | 39% | 9% | 22% | 27%
python/IAM_USER_USED_LAST_90_DAYS0% | 31% | 8% | 18% | 41%
python/EC2_SECURITY_GROUP_NOT_USED0% | 30% | 11% | 35% | 22%
python/EMR_SECURITY_GROUPS_RESTRICTED0% | 22% | 14% | 38% | 24%
python/BUSINESS_SUPPORT_OR_ABOVE_ENABLED0% | 28% | 10% | 37% | 22%
python/LAMBDA_DLQ_CHECK0% | 31% | 11% | 17% | 39%
python/SECRETSMANAGER_MAX_SECRET_AGE0% | 28% | 11% | 23% | 36%
python/EBS_ENCRYPTED_VOLUMES_V20% | 20% | 27% | 27% | 24%
python/VPC_ENDPOINT_DEFAULT_POLICY0% | 23% | 28% | 22% | 25%
python/EMR_MASTER_NO_PUBLIC_IP0% | 25% | 28% | 15% | 31%
python/LAMBDA_CONCURRENCY_CHECK0% | 25% | 25% | 20% | 28%
python/SQS_TRANSIT_ENCRYPTION_CHECK0% | 25% | 24% | 19% | 31%
python/SQS_PUBLIC_ACCESS_CHECK0% | 25% | 24% | 19% | 31%
python/GUARDDUTY_UNTREATED_FINDINGS0% | 23% | 21% | 25% | 28%
python/SNS_ENCRYPTED_TOPIC_CHECK0% | 26% | 23% | 19% | 30%
python/CLOUDTRAIL_S3_DATAEVENTS_ENABLED0% | 26% | 23% | 19% | 30%
python/SQS_ENCRYPTION_CHECK0% | 26% | 22% | 19% | 32%
python/IAM_USER_MFA_ENABLED0% | 24% | 20% | 39% | 16%
python/AMI_OWNERID_CHECK0% | 25% | 21% | 24% | 28%
python/WAFV2_WEBACL_LOGGING_ENABLED0% | 26% | 21% | 19% | 32%
python/EC2_SECURITY_GROUP_BADINGRESS0% | 25% | 19% | 18% | 36%
python/KMS_KEYS_TO_NOT_DELETE0% | 27% | 21% | 16% | 35%
python/ALB_HTTP_TO_HTTPS_REDIRECTION_CHECK0% | 25% | 19% | 14% | 40%
python/S3_VPC_ENDPOINT_ENABLED0% | 27% | 20% | 20% | 31%
python/API_GW_AUTHORIZER_IN_PLACE0% | 24% | 17% | 29% | 27%
python/AMI_NOT_PUBLIC_CHECK0% | 28% | 20% | 16% | 34%
python/ECR_REPOSITORY_SCAN_ON_PUSH_CHECK0% | 25% | 18% | 24% | 31%
python/REST_API_GW_CUSTOMDOMAIN_CHECK0% | 26% | 19% | 25% | 29%
python/ENTERPRISE_SUPPORT_PLAN_ENABLED0% | 28% | 20% | 17% | 33%
python/ECS_AWSLOGS_CHECK0% | 27% | 19% | 20% | 33%
python/IAM_IP_RESTRICTION0% | 16% | 6% | 42% | 34%
python/S3_PUBLIC_ACCESS_SETTINGS_FOR_ACCOUNT0% | 18% | 7% | 37% | 37%
python/ECS_ECRIMAGE_CHECK0% | 26% | 10% | 33% | 29%
python/SNS_TOPIC_EMAIL_SUB_IN_DOMAINS0% | 27% | 11% | 32% | 28%
python/IAM_USER_PERMISSION_BOUNDARY_CHECK0% | 26% | 10% | 30% | 31%
python/ELASTICACHE_REDIS_CLUSTER_AUTO_BACKUP_CHECK0% | 26% | 10% | 26% | 36%
python/EFS_ENCRYPTED_CHECK0% | 28% | 11% | 28% | 32%
python/CLOUDWATCH_LOG_GROUP_ENCRYPTED0% | 28% | 11% | 28% | 31%
python/SAGEMAKER_NOTEBOOK_KMS_CONFIGURED0% | 27% | 11% | 27% | 33%
python/EKS_LOGGING_CHECK0% | 28% | 11% | 28% | 32%
python/EKS_PUBLIC_ACCESS0% | 28% | 11% | 27% | 32%
python/ELASTICSEARCH_IN_VPC_ONLY0% | 28% | 11% | 28% | 30%
python/ELASTICSEARCH_ENCRYPTED_AT_REST0% | 29% | 11% | 27% | 31%
python/API_GW_CACHE_ENABLED_AND_ENCRYPTED0% | 29% | 12% | 26% | 31%
python/SAGEMAKER_ENDPOINT_CONFIG_KMS_KEY_CONFIGURED0% | 27% | 11% | 23% | 37%
python/VPC_VPN_2_TUNNELS_UP0% | 29% | 11% | 25% | 33%
python/API_GW_EXECUTION_LOGGING_ENABLED0% | 29% | 12% | 24% | 34%
python/SHIELD_ADVANCED_ENABLED_AUTORENEW0% | 29% | 12% | 24% | 34%
python/EBS_SNAPSHOT_PUBLIC_RESTORABLE_CHECK0% | 28% | 11% | 22% | 37%
python/SHIELD_DRT_ACCESS0% | 29% | 12% | 23% | 34%
python/SAGEMAKER_NOTEBOOK_NO_DIRECT_INTERNET_ACCESS0% | 28% | 11% | 22% | 36%
python/DMS_REPLICATION_NOT_PUBLIC0% | 30% | 12% | 23% | 34%
python/CLOUDFRONT_WEBACL_CHECK0% | 29% | 12% | 22% | 35%
python/VPC_ENDPOINT_MANUAL_ACCEPTANCE0% | 29% | 12% | 17% | 40%
python/LAMBDA_INSIDE_VPC0% | 30% | 12% | 17% | 39%
python/S3_BUCKET_NAMING_CONVENTION0% | 30% | 12% | 18% | 39%
python/IAM_USER_MATCHES_REGEX_PATTERN0% | 30% | 12% | 18% | 38%
python/RDS_ENHANCED_MONITORING_ENABLED0% | 30% | 12% | 18% | 38%
python/ELB_DELETION_PROTECTION_ENABLED0% | 30% | 12% | 18% | 38%
python/CLOUDFRONT_VIEWER_POLICY_HTTPS0% | 31% | 12% | 18% | 37%
python/API_GW_ENDPOINT_TYPE_CHECK0% | 31% | 12% | 18% | 37%
python/EC2_INSTANCE_NO_PUBLIC_IP0% | 31% | 12% | 18% | 36%
python/' RDK parameters.json for AWS Managed Config Rules0% | 31% | 12% | 18% | 36%
python/REDSHIFT_CLUSTER_PUBLIC_ACCESS_CHECK0% | 31% | 12% | 18% | 36%
python/IAM_ACCESS_KEY_ROTATED0% | 25% | 26% | 17% | 29%
python/VPC_SG_OPEN_ONLY_TO_AUTHORIZED_PORTS0% | 22% | 18% | 20% | 38%
python/ELB_ALB_PREDEFINED_SSL_CHECK0% | 26% | 10% | 21% | 41%
python/VPC_FLOW_LOGS_ENABLED_CUSTOM0% | 22% | 33% | 13% | 30%
python/API_GW_PRIVATE_RESTRICTED0% | 21% | 24% | 23% | 31%
python/API_GW_RESTRICTED_IP0% | 21% | 9% | 36% | 32%
python/API_GW_NOT_EDGE_OPTIMISED0% | 26% | 11% | 31% | 29%
python/DYNAMODB_ENCRYPTED_CUSTOM0% | 28% | 12% | 24% | 35%
python/CLOUDTRAIL_ENABLED_V20% | 22% | 32% | 13% | 31%
python/IAM_ROLE_NO_POLICY_FULL_STAR0% | 23% | 20% | 24% | 31%
python/IAM_USER_NO_POLICY_FULL_STAR0% | 23% | 20% | 24% | 31%
python/IAM_GROUP_NO_POLICY_FULL_STAR0% | 23% | 20% | 24% | 31%
python/IAM_NO_USER0% | 26% | 11% | 28% | 32%
python/IAM_POLICY_REQUIRED0% | 23% | 10% | 25% | 40%
python/INTERNET_GATEWAY_AUTHORIZED_ONLY0% | 29% | 12% | 17% | 41%
python/CLOUDFRONT_LOGGING_ENABLED0% | 29% | 13% | 17% | 39%
python/EC2_TAG_MATCHES_INSTANCE_PROFILE_NAME0% | 27% | 22% | 16% | 33%
python/INSTANCE_PROFILE_HAVE_DEFINED_POLICIES0% | 28% | 13% | 22% | 35%
python/ROOT_NO_ACCESS_KEY0% | 29% | 13% | 18% | 39%
python/LAMBDA_CODE_IS_VERSIONED0% | 24% | 22% | 25% | 28%
python0% | 4% | 52% | 34% | 8%
node0% | 0% | 55% | 7% | 36%
python-rdklib/EC2_INSTANCE_EBS_VOLUME_TAGS_MATCH0% | 0% | 62% | 10% | 26%
python/LAMBDA_ROLE_ALLOWED_ON_LOGGING0% | 0% | 35% | 21% | 43%
python-rdklib/AMI_DEPRECATED_CHECK0% | 0% | 22% | 54% | 23%
java/src0% | 0% | 0% | 21% | 78%
python-rdklib/SECURITYHUB_ENABLED0% | 0% | 0% | 76% | 23%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def lambda_handler()
in python/IAM_USER_USED_LAST_90_DAYS/IAM_USER_USED_LAST_90_DAYS.py
94 32 2
def evaluate_compliance()
in python/AMI_OUTDATED_CHECK/AMI_OUTDATED_CHECK.py
89 9 3
def lambda_handler()
in python/EC2_SECURITY_GROUP_NOT_USED/EC2_SECURITY_GROUP_NOT_USED.py
75 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/EMR_SECURITY_GROUPS_RESTRICTED/EMR_SECURITY_GROUPS_RESTRICTED.py
74 25 2
def lambda_handler()
in python/LAMBDA_DLQ_CHECK/LAMBDA_DLQ_CHECK.py
74 25 2
def lambda_handler()
in python/SECRETSMANAGER_MAX_SECRET_AGE/SECRETSMANAGER_MAX_SECRET_AGE.py
71 25 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/EBS_ENCRYPTED_VOLUMES_V2/EBS_ENCRYPTED_VOLUMES_V2.py
69 22 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/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