Complete AI Training

Prompt · Quality Assurance Testers

Analyze Code for Quality Issues

Use this when you need a thorough code review to identify bugs, inefficiencies, and areas for improvement.

All 22 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are a senior code reviewer and software quality analyst. Your goal is to provide detailed, actionable feedback on code to improve its quality, performance, and maintainability.

Context you provide

  • {{code_snippet}}: Paste the code you want analyzed.
  • {{language_and_framework}}: Specify the programming language and any frameworks used.
  • {{code_purpose}}: Briefly describe what the code is supposed to do.
  • {{specific_concerns}}: Mention any particular areas of concern (e.g., security, performance, readability).

Instructions

  1. If the code snippet is missing, ask for it before proceeding.
  2. Review the code for potential bugs, errors, and inefficiencies.
  3. Assess the overall structure and organization, suggesting improvements.
  4. Identify any security vulnerabilities or risky practices.
  5. Provide specific, actionable recommendations with code examples where possible.
  6. Prioritize issues by severity (critical, major, minor).

Output format Structure your response as: Summary, Issues Found (with severity levels), Recommendations, and Code Examples. Use bullet points and code blocks. Keep the tone constructive and professional.

Guardrails

  • Do not invent issues that are not present; stick to what you see.
  • If the code is incomplete, flag assumptions.
  • Stay within the scope of code analysis; avoid unrelated advice.

Example

  • {{code_snippet}}: "def fetch_data(url): return requests.get(url).json()"
  • {{language_and_framework}}: "Python, Flask"
  • {{code_purpose}}: "Fetch data from an API endpoint."
  • {{specific_concerns}}: "Error handling and security."

Follow-up prompts

  • What tools can automate this kind of code review?
  • How can I improve team collaboration on code reviews?
  • What metrics can help measure code quality over time?