arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~

SmellCC:一种用于自动修复代码异味的工具

SmellCC: A Tool for Automated Code Smells Remediation

Xiaoting Zhang, Yujie Zhang, Zhipeng Gao, Xing Hu, Xin Xia

arXiv 2608.09477首次发表:更新:

AI 中文总结

SmellCC是一款Visual Studio Code扩展,结合SonarQube与LLM流水线,采用思维链和少样本学习,可一键修复Python前10种常见代码异味,清洁率96.8%、准确率91.3%,能提升软件可维护性。

AI 中文摘要

代码异味会累积技术债务,严重威胁软件可维护性,但开发者在紧张的发布周期下往往缺乏资源手动修复这些缺陷。虽然SonarQube等静态分析工具能精准检测,但它们主要作为被动警报系统,重构负担仍落在开发者身上。为弥合这一差距,我们提出一种新型清理工具SmellCC,它是Visual Studio Code扩展,通过基于大语言模型(LLM)的流水线增强SonarQube,自动检测并重构Python代码异味。SmellCC采用思维链(CoT)和少样本学习,为排名前10的最常见代码异味提供原位一键修复,有效防止开发期间技术债务累积。我们的定量评估表明,SmellCC在帮助开发者有效消除代码异味方面颇具前景,清洁率达96.8%,准确率为91.3%,确保重构后的代码保持语法正确且行为一致,从而显著提升长期软件可维护性。

英文摘要

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.

DOI:10.1145/3832783.3834611

论文原文

arXiv 摘要页 · PDF 原文 · HTML 原文

↑