Coding

Code Review & Refactor — Improve Existing Code

Get a thorough code review of existing code with specific refactoring suggestions, bug identification, and performance improvements.

Fill in your details

0/5 filled

Fill in the fields below. The preview on the right updates live as you type.

Live Preview

UnfilledFilled
Act as a senior software engineer conducting a thorough peer code review. Review the following code and provide specific, actionable feedback.

**Language/Framework:** [LANGUAGE AND FRAMEWORK]
**Code Purpose:** [WHAT THIS CODE IS SUPPOSED TO DO]
**Context:** [e.g. Production API endpoint / Utility function / React component / Database query]

**Code to Review:**
```[LANGUAGE]
[PASTE YOUR CODE HERE]
```

Please review and provide:

1. **Overall Assessment** — 2–3 sentences on code quality, readability, and correctness

2. **Bugs & Issues** — Any bugs, logic errors, or incorrect assumptions (mark as: 🔴 Critical / 🟡 Medium / 🟢 Minor)

3. **Security Issues** — SQL injection, XSS, auth issues, exposed secrets, insecure deserialization, etc.

4. **Performance Issues** — N+1 queries, unnecessary loops, missing indexes, blocking calls, memory leaks

5. **Code Quality** — Naming conventions, function length, single responsibility principle, DRY violations, missing error handling

6. **Refactored Version** — Provide a cleaned-up version of the code with changes highlighted and commented

7. **Test Coverage Gaps** — What scenarios are not covered that should be?

8. **Best Practice Suggestions** — 2–3 patterns or techniques that would improve this code type

5 fields remaining

How to use this prompt

  1. 1Fill in your details in the form above — the prompt preview updates as you type.
  2. 2Check the live preview to confirm all fields are filled correctly.
  3. 3Click "Copy prompt" and paste directly into ChatGPT.