mlsanityData to 7 Oct 2026

Copilot-in-the-Loop: Fixing Code Smells in Copilot-Generated Python Code using Copilot

arXiv 2401.14176 ↗First posted 25 Jan 2024cs.SE cs.AIcited by 2

Not on the map. Why?

Abstract (arXiv)

As one of the most popular dynamic languages, Python experiences a decrease in readability and maintainability when code smells are present. Recent advancements in Large Language Models have sparked growing interest in AI-enabled tools for both code generation and refactoring. GitHub Copilot is one such tool that has gained widespread usage. Copilot Chat, released in September 2023, functions as an interactive tool aimed at facilitating natural language-powered coding. However, limited attention has been given to understanding code smells in Copilot-generated Python code and Copilot Chat's ability to fix the code smells. To this end, we built a dataset comprising 102 code smells in Copilot-generated Python code. Our aim is to first explore the occurrence of code smells in Copilot-generated Python code and then evaluate the effectiveness of Copilot Chat in fixing these code smells employing different prompts. The results show that 8 out of 10 types of code smells can be detected in Copilot-generated Python code, among which Multiply-Nested Container is the most common one. For these code smells, Copilot Chat achieves a highest fixing rate of 87.1%, showing promise in fixing Python code smells generated by Copilot itself. In addition, the effectiveness of Copilot Chat in fixing these smells can be improved by providing more detailed prompts.

Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Builds on 4 of its 31 references that are in the map. First posted on arXiv 25 Jan 2024.

Builds on

4 of 31 references.

References · 4

  1. 2020Language Models are Few-Shot Learnerscited by 32,199
  2. 2023MetaGPT: Meta Programming for A Multi-Agent Collaborative Frameworkcited by 1,761
  3. 2023Harnessing the Power of LLMs in Practice: A Survey on ChatGPT and Beyondcited by 409
  4. 2023An Analysis of the Automatic Bug Fixing Performance of ChatGPTcited by 108

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 2.

2 papers.