Skip to content

huynguyen2703/Code-Smell-Detector

Repository files navigation

🧼 Code Smell Detector Web App

A powerful refactoring assistant that detects code smells and suggests intelligent improvements using LLMs (Large Language Models). Built for developers, this web-based tool includes a live coding IDE, multi-language support, and seamless AI integration — helping you write cleaner code, faster.

🚀 Created using modern web technologies, AI models, and AWS cloud services.


📸 Demo Preview

Code Smell Detector Demo

✨ Example: Python code analysis detecting a Long Parameter List and Primitive Obsession code smell using LLM evaluation.


🌟 Features

  • 💻 Web IDE: Paste code directly in the browser.
  • 🧠 Multi-LLM Evaluation: Analyzes code using multiple large language models.
  • 🌐 Multi-language Detection: Supports Python, JavaScript, Java, and more.
  • 🔍 Refactoring Suggestions: Get practical, explainable tips to improve code quality.
  • 🛠️ Built for Developers: IDE-style experience with language selection.
  • ☁️ Scalable Cloud Deployment: AWS-ready architecture.
  • 🧠 Powered by Python 3.11 for backend AI analysis.

🧰 Tech Stack

🎨 Frontend

  • Next.js Next.js
  • Tailwind CSS (optional for styling)

⚙️ Backend

  • Node.js Node.js
  • Express Express.js
  • Python Python 3.11 (LLM Evaluation Microservice)

🛢️ Database

  • MongoDB MongoDB

☁️ Deployment (Tested on AWS)

  • AWS Amplify Amplify – Frontend hosting
  • Amazon ECS ECS – Container orchestration
  • Amazon ECR ECR – Docker image storage
  • API Gateway API Gateway – API routing

🖼 Screenshot Example

📌 The example above shows a Python function create_user_profile passed into the tool:

  • Detected Long Parameter List smell with 8 parameters
  • Detected Primitive Obsession (relying on primitive types)
  • Models recommended grouping data into a class like UserProfile

🧪 How to Run Locally

🔧 Prerequisites

  • Node.js (v18+)
  • Python 3.11+
  • MongoDB
  • Docker (optional for container setup)

📦 Install Frontend

cd frontend
npm install
npm run dev

cd backend
npm install
node index.js


🛣 Roadmap
 More language support (Go, Rust, C++)

 OAuth login (GitHub or Google)

 User history dashboard

 Upload full files / drag-and-drop

 In-browser refactor preview

🧑‍💻 Author
Huy Quoc Nguyen



⚠️ Deployment Notes
💸 Full deployment was tested on AWS but paused to prevent excessive costs.

📄 License
MIT License – free for personal and educational use.

About

CPSC 4260 quarter long project surrounds creating a code smell detector for general code smells

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published