# alembic — CWE-407 Scan: CLEAN Scanned: 2026-03-29 ## Scope - `alembic/script/revision.py` — migration DAG traversal - `targets = set(targets)` (line 676) - `todo = {d.revision for d in revisions}` (line 946, set comprehension) - `current_heads` — tuple/set backed - `alembic/runtime/migration.py` — `heads` is tuple from revision graph ## Verdict No CWE-407 (algorithmic complexity / quadratic membership check) defects found. Migration dependency graph traversal and conflict detection use `set` comprehensions throughout. No list-based membership checks in the revision walk.