Time-dependent default argument
Part of Code Quality & Syntax, which counts for 20% of the overall score. When this check fires it deducts 4 points from that category, once per scan, no matter how many places it turns up.
What it detects
A default argument such as datetime.now() is evaluated once at function-definition time, so every call using the default gets the same frozen value.
Why it matters
A default argument such as created_at=datetime.now() is evaluated once, when the function is defined (typically at import time), not on every call, so every call that uses the default gets the same frozen timestamp from process startup instead of the current time. In a short-lived script this can go unnoticed, but in a long-running server the timestamp silently drifts further from reality the longer the process stays up.
How to fix it
Use None as the default and compute the timestamp inside the function body, for example def schedule_job(name, created_at=None): created_at = created_at or datetime.now(). This way the value is computed fresh on every call that does not supply its own.
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