SmellCC: A Tool for Automated Code Smells Remediation

2026-08-10Software Engineering

Software Engineering
AI summary

The authors created SmellCC, a tool that helps programmers fix common Python coding problems called 'code smells' automatically within Visual Studio Code. It works alongside SonarQube by using advanced AI techniques to detect issues and then fix them with just one click. Their tests show SmellCC can clean about 97% of code smells accurately while keeping the code working correctly. This helps developers avoid technical debt and maintain their software more easily over time.

code smellstechnical debtSonarQubeVisual Studio CodePythonlarge language modelsChain-of-Thoughtfew-shot learningcode refactoringsoftware maintainability
Authors
Xiaoting Zhang, Yujie Zhang, Zhipeng Gao, Xing Hu, Xin Xia
Abstract
Code smells significantly threaten software maintainability by accumulating technical debt, yet developers often lack the resources to manually address these flaws under tight release schedules. While static analysis tools like SonarQube provide precise detection, they function largely as passive alert systems, leaving the burden of refactoring on developers. To bridge this gap, we present a novel cleaning tool, namely SmellCC, a Visual Studio Code extension that augments SonarQube with an LLM-based pipeline to automatically detect and refactor Python code smells. By employing Chain-of-Thought (CoT) and few-shot learning, SmellCC provides in-place, one-click remediation for the top-10 most frequent smells, effectively preventing the accumulation of technical debt during development. Our quantitative evaluation demonstrates that our SmellCC is promising in helping developers effectively eliminate code smells (96.8\% cleaning rate) with high accuracy (i.e., 91.3\%), ensuring that the refactored code remains syntactically correct and behavior-preserving, thereby significantly improving long-term software maintainability.