Paste any code for a structured review — bugs, security, performance — ranked by severity, with the top fix implemented.
Review this code as a principal engineer. Language/context: {LANGUAGE, FRAMEWORK, WHAT IT DOES}.
Structure your review:
[RED] BUGS & CORRECTNESS: actual defects, edge cases that break (empty input, huge input,
concurrent access), off-by-ones. Show the failing case.
[ORANGE] SECURITY: injection, unvalidated input, secrets, authz gaps — with the attack scenario.
[YELLOW] PERFORMANCE: only issues that matter at realistic scale (N+1 queries, O(n²) on unbounded data). No micro-optimization theater.
[GREEN] MAINTAINABILITY: naming, structure, testability — max 3 items, most impactful only.
Then: the single most important fix, implemented in full.
Rules: cite line references, no style nitpicks a linter would catch, and say "this part is good" where it's good.
CODE:
{PASTE}