TRUNCATE TABLE statement present
Part of Code Quality & Syntax, which counts for 20% of the overall score. When this check fires it deducts 2 points from that category, once per scan, no matter how many places it turns up.
What it detects
TRUNCATE unconditionally wipes every row in the table and, unlike DELETE, has no WHERE form at all, so there is no way to scope it. This is very often intentional in a seed/reset script, but it is worth a second look if it ever runs against a real environment.
Why it matters
TRUNCATE removes every row in the table with no WHERE-clause equivalent at all, so unlike DELETE there is no way to scope it after the fact. This is frequently exactly what a seed/reset script wants, but the same script sometimes gets run against the wrong database by mistake. This finding is informational: it exists to make you double-check, not because TRUNCATE is inherently wrong.
How to fix it
If this script is meant only for local/test resets, keep it but consider gating it behind an explicit environment check so it cannot run against a non-development database by accident. If it is meant to run in a real migration, make sure that is deliberate and documented.
The paid report includes a ready-to-paste prompt for your AI coding agent for every check it finds, pointed at the exact findings from your scan. See pricing
Does your repo trip this check?
Paste a GitHub URL or drop a project folder. Scans run in your browser and take seconds.
Scan your repo