Aug 2026· WiPiEC Journal - Works in Progress in Embedded Computing Journal· 0 citations· 34 references
TL;DR
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.
Abstract
With the observed progress in machine learning (ML), and particularly the introduction of Large Language Models (LLMs), several activities related to code maintenance could be automated. That includes not only detection and evaluation of design flaws, but also code transformation and refactoring. However, the general-purpose LLMs, while being commonly used and popular, have not been specifically trained for code analysis, and may not be suitable for conducting software maintenance tasks due to biases, and inherent shortcomings of the models. In this paper, we explore if the widely available LLMs could aid the detection and the refactoring of code smells. We focus on four common smells (God Class, Long Method, Feature Envy, and Refused Bequest) and consider five prompts of diverse complexity, asking the model for detecting and removing the identified code smells. Results suggest that general-purpose LLMs cannot be reliably used for that. They can effectively detect or remove code smells only in simple cases, and frequently produce invalid code. However, their performance depends on various factors, e.g., the model, the specific code smell or the prompt objective and composition.
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.
Xiaoting Zhang, Yujie Zhang, Zhi-Peng Gao et al.· 0 citations
It is observed that generated code often omits basic input validation or memory-safety checks, which can lead to overflows, resource exhaustion, or other reliability/security issues, and even the largest models frequently make simple mistakes.
Rodrigo Pato Nogueira, Marco Vieira, João R. Campos· 0 citations
JavaScript is one of the most popular programming languages. As projects grow, their code can become complex which leads to code smells, signs that can indicate problems. Many tools are available to detect and fix these issues, but we need a comprehensive summary of their most important features. This paper provides a systematic literature review of JavaScript code smell detection tools. We searched four databases (Scopus, ACM Digital Library, IEEE Xplore, and Springer) using a specific search string to find relevant studies. To refine the results, we applied a four-step selection process, reducing 1002 initial studies to 18 by removing duplicates, filtering metadata, and reviewing their full texts. We then used backward and forward snowballing to find more relevant studies, increasing the total number to 27 primary studies. Finally, we examined these studies to analyze the code smell detection tools they described. We identified 22 tools, many published in top software engineering venues, such as ICSE, MSR and TSE. We found that most tools use rule-based linting (55%), which is efficient but struggles with complex architectural smells. Dynamic analysis (23%) is underused and AI-driven detection is completely missing, despite its relevance in modern software engineering research. Researchers are also developing framework-specific tools for modern JavaScript practices and focusing on the detection of test smells (22%). Most tools available to practitioners detect only basic smells and ignore deeper design issues. Tool builders can address these gaps by combining static and dynamic analysis and creating more adaptable tools. For researchers, the lack of AI-driven detection and modern benchmark datasets presents an opportunity for progress.
Unknown authors· SBC Reviews on Computer Scie...· 0 citations
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· IEEE Jordan Conference on Ap...· 0 citations
Code smells are indicative of poor software design, maintainability issues, or potential defects, and their early detection is critical for high-quality software development. Traditional detection methods rely heavily on manual inspection or rule-based static analysis, which are often time-consuming, error-prone, and limited in adaptability. This paper explores the use of machine learning techniques for automated code smell detection and resolution. By leveraging code metrics, syntactic and semantic features, and historical refactoring data, ML models can identify patterns associated with common code smells and recommend targeted resolution strategies. The proposed approach is evaluated on open-source and industrial software projects, demonstrating improvements in detection accuracy, maintainability, and developer productivity. The study highlights the potential of intelligent, data-driven approaches to enhance software quality and support continuous code improvement.
Emily Johnson· International Journal of Mac...· 0 citations
Results indicate that static checks and test-guided, context-aware agentic repair can increase the reliability of LLM-generated refactorings, bringing them closer to practical integration within developer workflows.
Jonathan Cordeiro, Shayan Noei, Ying Zou· 1 citation
We use cookies to run the site and, with your consent, for analytics and to show ads.
See our Cookie Policy.