Skip to content
Preprint

SmellCC: A Tool for Automated Code Smells Remediation

Aug 2026 · 0 citations · 21 references
Computer Science

TL;DR

SmellCC, a Visual Studio Code extension that augments SonarQube with an LLM-based pipeline to automatically detect and refactor Python code smells, provides in-place, one-click remediation for the top-10 most frequent smells, effectively preventing the accumulation of technical debt during development.

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.

View source

Similar papers

Open access 2026

Fine-Tuning UniXcoder for Code Smell Detection in Java Projects

Code smells are symptoms of poor software design that hinder maintainability and increase technical debt interest. Automated detection of code smells is crucial in software development industry, where manual inspection is costly and error-prone. Although several studies have explored code smell detection, most existing approaches, both structural/metric-based and textual/transformer-based, still exhibit limitations in capturing the semantic context of source code to handle complex smells effectively. This study investigates the application of UniXcoder, a pre-trained transformer model for source code, to classify Java source code methods across multiple projects as smell or clean, with a particular focus on the Switch Statements smell. The proposed method fine-tunes UniXcoder and evaluates its performance using standard metrics, namely accuracy, precision, recall, and F1-score, in comparison with traditional machine learning models based on structural metrics and textual representations. Experimental results show that the fine-tuned UniXcoder achieves the highest classification accuracy of 80.2%, the highest precision among all baseline methods evaluated, indicating its effectiveness in minimizing false positives. These findings confirm that pre-trained transformer models, particularly UniXcoder, are capable of understanding both the semantic and syntactic structures of code and demonstrate stronger performance than frequency-based textual representation approaches as well as software metrics-based approaches. Furthermore, the results highlight UniXcoder’s potential for integration into industrial software engineering workflows, supporting automated code smell detection as part of continuous code quality assurance.

Hanson Prihantoro Putro, Umi Laili Yuhana, E. M. Yuniarno et al. · 0 citations
Open access Aug 2026

An Exploratory Study on Code Smells Detection and Refactoring using LLMs

This paper focuses on four common smells and considers five prompts of diverse complexity, asking the model for detecting and removing the identified code smells, and suggests that general-purpose LLMs cannot be reliably used for that.

Giorgia Paisi, Francesca Arcelli Fontana, Bartosz Walter · 0 citations
Open access 2020

Machine Learning for Code Smell Detection and Resolution

The study highlights the potential of intelligent, data-driven approaches to enhance software quality and support continuous code improvement by leveraging code metrics, syntactic and semantic features, and historical refactoring data.

Emily Johnson · 0 citations
Conference Jul 2026

AI4SE for CI/CD: Explainable Code Smell Risk Analysis

Continuous Integration and Continuous Delivery (CI/CD) pipelines accelerate software evolution but complicate the timely assessment of structural degradation. While code smells effectively indicate maintainability risks, their detection remains largely confined to isolated static analysis rather than being actively integrated into continuous workflows. To address this gap, we propose an explainable AI-driven approach for code smell classification designed specifically for software quality risk analysis in CI/CD environments. Using structural metrics related to complexity, coupling, and cohesion, we train a Random Forest model to classify four prevalent smells: Blob, Long Method, Feature Envy, and Data Class. Evaluated on labeled Java systems, our approach successfully captures the structural patterns indicative of software decay, achieving 82% accuracy and a 0.86 macro F1-score. Beyond raw performance, we operationalize these classifications as interpretable risk indicators within a prototype CI/CD pipeline, prioritizing human-centered evaluation. Ultimately, this work advances the AI for Software Engineering (AI4SE) domain by demonstrating how explainable machine learning can practically augment continuous quality assurance in agile development.

J. Domingues, D. Duarte, António Sousa et al. · 0 citations
Conference Jul 2026

Understanding and Reducing Code Smells in AI-Generated Java Code Using Explainable AI and Prompt Optimization

Recently, Developers have been relying on AI tools to support them in their daily work by generating code. While the use of large language model-based AI tools has improved productivity, the quality of the generated code wasn't always optimal. In a lot of cases, the code includes design issues known as code smells, which negatively impact readability, maintainability, and future development. This paper investigates these issues in AI-generated Java code, with a focus on common object-oriented problems such as switch statements, temporary fields, and refused bequest. A structured approach is proposed that combines static analysis tools with explainable AI techniques to better understand why these problems appear. Based on the realized insights, prompts are optimized to guide the AI model towards generating cleaner and more structured code. The results showed clear improvement after the prompt optimization, where the number of detected code smells was reduced by 66%, and completely removed (100% reduction) in some cases. Overall, the study showed that improving prompt design, supported by explainable analysis, can significantly enhance the quality of AI-generated code.

Y. Younes, Yousef Elsheikh · 0 citations
Review Aug 2026

Code Refinement with Repository Context: How Far are We?

A high-quality benchmark of 1,000 code refinement instances from 328 Python, Java, and JavaScript repositories that focused on one of the most challenging code refinement scenarios that strictly requires repository-level knowledge reasoning, and a straightforward method, RepoRefiner, which retrieves repository-level context by collecting the full file content, extracting definitions of its identifiers, and summarizing these contexts to support code refinement.

Ke Wang, Peng Lan, Jiakun Liu et al. · 1 citation

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.