paperbot · PL 论文追踪

全部论文 待读 收藏

P2 SmellCC: A Tool for Automated Code Smells Remediation

SmellCC:一种自动化代码坏味道修复工具
ASE Proceedings of the 41st IEEE/ACM International Conference on Automated Software Engineering2026匹配度 4/10 · 论文将LLM与静态分析工具SonarQube结合用于代码坏味道修复,属于AI辅助软件工程,与用户关注的“AI→PL”方向有交叉,但核心是代码重构而非静态分析或形式化验证,且方法以工程集成为主,创新性有限。引用 0 inbox
Xiaoting Zhang, Yujie Zhang, Zhipeng Gao, Xing Hu, Xin Xia
crossref: 2026-10-09

AI 速览

一句话:提出 VS Code 扩展 SmellCC,结合 SonarQube 与 LLM 流水线,一键检测并重构 Python 代码坏味道。

代码坏味道会累积技术债、威胁软件可维护性,但开发者在紧张的发布周期下往往无力手工重构;SonarQube 等静态分析工具虽能精确检测,却只是被动告警,重构负担仍落在开发者身上。为弥补这一缺口,本文提出 SmellCC——一个 Visual Studio Code 扩展,在 SonarQube 之上叠加基于 LLM 的流水线,自动检测并重构 Python 代码坏味道。该方法采用思维链(CoT)与少样本学习,针对最高频的 10 类坏味道提供就地、一键式修复,力图在开发过程中阻止技术债积累。定量评估表明其清理率达 96.8%、准确率 91.3%,重构后的代码保持语法正确且行为等价,从而显著提升长期可维护性。本文重点在于将此前发表于 TOSEM 的离线大规模语料清理流水线,重新实现为把 IDE 内 SonarQube 诊断转化为交互式就地重构动作的 IDE 原生工具。

问题
代码坏味道持续积累技术债,而现有静态分析工具仅提供被动告警,开发者缺乏在开发流程中即时消解坏味道的手段。
方法
以 SonarQube 的 IDE 诊断为基础,构建基于 LLM(思维链加少样本提示)的流水线,在 VS Code 中对前 10 类高频 Python 坏味道提供就地、一键式重构。
评估
通过定量评估在代码坏味道清理任务上测得 96.8% 的清理率与 91.3% 的准确率,并验证重构代码语法正确、行为保持不变。
原文摘要(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 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. The full paper underlying this tool has been published in ACM Transactions on Software Engineering and Methodology, where SmellCC was introduced and evaluated as an offline pipeline for large-scale code corpus cleaning. Extending this prior work, the present paper focuses on an IDE-native implementation of SmellCC that translates SonarQube for IDE diagnostics into interactive, in-place refactoring actions within Visual Studio Code.

链接与引用

DOI 原文 · arXiv ·

BibTeX
@inproceedings{paperbot12404,
  title = {SmellCC: A Tool for Automated Code Smells Remediation},
  author = {Xiaoting Zhang and Yujie Zhang and Zhipeng Gao and Xing Hu and Xin Xia},
  booktitle = {ASE},
  year = {2026},
  doi = {10.1145/3832783.3834611}
}