Will It Vibe?
CQ-011Info severity-2 points

Magic number in condition

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

Unexplained numeric literals in conditionals hurt readability; prefer a named constant.

Why it matters

This flags multi-digit numeric literals inside if/while conditions. A raw threshold in a condition forces every reader to guess what it means and whether it is safe to change, and when the same number is needed elsewhere it gets retyped slightly differently and the two sites drift apart.

How to fix it

Extract each number into a named constant near the top of the module (SCREAMING_SNAKE_CASE works in both JS/TS and Python) with a name stating its meaning and unit, for example MAX_RETRIES or SESSION_TTL_SECONDS. If several files share the threshold, move it to a shared constants module so there is one source of truth.

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

Related Code Quality & Syntax checks