expression-complexity
Limit Terraform statement and variable-validation expression complexity.
Why
Large predicates hide independent deployment requirements and make an infrastructure change difficult to review.
Fix
Delete redundant checks or name independently meaningful expressions. Preserve lazy evaluation, null guards and dependencies; preserve substantive domain safeguards until equivalent protection is established under the guard-block policy.
Examples
locals { value = true ? (true ? (true ? (true ? (true ? (true ? (true ? (1) : 2) : 2) : 2) : 2) : 2) : 2) : 2}locals { value = 1}Autofix output
locals { value = 1}locals { ready = var.a > 0 && var.b > 0 && var.c > 0 && var.d > 0 && var.e > 0 && var.f > 0 && var.g > 0}variable "port" { type = number validation { condition = var.port > 0 && var.port < 65536 error_message = "Supply a valid port." }}