Code Review and Refactoring

folder Coding & Dev Prompts smart_toy ChatGPT (GPT-4o) visibility 3 views content_copy 0 copies

Get a thorough code review with refactored output, security checks, and best practices.

code Prompt
Review and refactor this [Language] code for quality, performance, and maintainability:

```[language]
[Paste your code here]
```

Analyze for:
1. Code smells (long methods, duplications, magic numbers)
2. SOLID principles violations
3. Security vulnerabilities
4. Performance bottlenecks
5. Error handling gaps
6. Missing input validation
7. Documentation gaps
8. Test coverage opportunities
9. Naming conventions
10. Design pattern opportunities

Provide:
- Line-by-line issues with severity (critical/major/minor)
- Refactored version with comments explaining changes
- Unit test suggestions
- Performance benchmarks (before/after)
- Best practice alternatives

help_outline How To Use This Prompt

Paste your code and specify the language and what the code is supposed to do.

lightbulb Example Output

Critical Issue (Line 23): SQL injection vulnerability. Raw user input in query. Fix: use prepared statements...

quiz Frequently Asked Questions

What is the "Code Review and Refactoring" prompt used for? expand_more
Get a thorough code review with refactored output, security checks, and best practices.
Which AI models work with this prompt? expand_more
This prompt works best with ChatGPT (GPT-4o). You can also try it with other large language models for similar results.
Can I modify this prompt? expand_more
Yes! Feel free to copy and customize this prompt to better fit your specific needs. You can change names, industries, tones, or any other variables to personalize the output.
Is this prompt free to use? expand_more
Absolutely. All prompts on GetPromptPro are free to copy and use for personal or commercial purposes.