Summary
`ListReachabilityTargets` in `internal/services/aws/vpc.go` is a 240-line function that fetches 8 different AWS resource types (EC2 instances, ENIs, IGWs, VPC endpoints, VPC peering, transit gateways, VPN gateways, service configs) with inline mapping logic per type. It violates single responsibility and makes adding new resource types risky.
Details
- Each resource type has 10–15 lines of inline mapping logic inside the single function
- Adding a new target type or changing a field mapping requires reading the entire 240-line function to find the right place
- There is no unit-testable seam for individual resource collectors
Checklist
References
- `internal/services/aws/vpc.go:136-375`
Raised from senior code review (2026-05-12).
Summary
`ListReachabilityTargets` in `internal/services/aws/vpc.go` is a 240-line function that fetches 8 different AWS resource types (EC2 instances, ENIs, IGWs, VPC endpoints, VPC peering, transit gateways, VPN gateways, service configs) with inline mapping logic per type. It violates single responsibility and makes adding new resource types risky.
Details
Checklist
References
Raised from senior code review (2026-05-12).