Loading…
Loading…
There's a stub auth validation function on main. A colleague sent a PR with the full implementation: token length, attempt limit, TTL, user lockout. The logic works, but the code is peppered with magic numbers and strings with no context. Walk the diff — how many of these should be lifted into constants?
A magic value is any number or string in code without a name or explanation. Examples: `< 32`, `* 3600000`, `status === 2`, `role === 'admin'`. Problems: (1) unclear what it means; (2) duplication — the same number in multiple places; (3) changing it forces you to update everywhere and not miss any. Look at the code — how many such values do you see?