GeminiSpark

Detect And Eliminate Code Smells

During code review or when you feel the code is hard to understand and change.

Prompt

As a code quality expert, review the following [LANGUAGE] code and identify all code smells (e.g., long method, large class, primitive obsession). For each smell, explain why it's problematic and provide a concrete refactoring solution. Code: [CODE SNIPPET]

Fill in these

Swap each placeholder for your own value:

  • [LANGUAGE]
  • [CODE SNIPPET]

Pro tips

  • Run a static analysis tool first to get initial hints, then ask Gemini for deeper insights.
  • Focus on a single class or module at a time for thorough analysis.

Want to run prompts like this for free?

Try GeminiOmni — a free playground for Gemini-powered chat, images and video.

Try These Prompts Free

Related prompts