Evaluating the Effectiveness of ChatGPT in Improving Code Quality
Code refactoring is a crucial process in software development that helps improve the quality and maintainability of code without changing its functionality. Although code refactoring is widely recognized as an essential practice, measuring its impact on code quality is challenging. This paper investigates the impact of ChatGPT, on code quality. The study focuses on four key metrics: cyclomatic complexity, cognitive complexity, code smells, and time debt, using Sonarqube to assess code quality and identify potential issues. The original dataset of Python code is compared with the refactored dataset to evaluate the effectiveness of ChatGPT in improving code quality. The results demonstrate that ChatGPT's refactoring efforts have led to improvements in the quality of the codebase. The refactored code exhibited lower complexity values, fewer code smells, and reduced time debt, highlighting ChatGPT's success in addressing significant issues that can cause system failures and performance issues. The study emphasizes the potential benefits of using ChatGPT for code refactoring, which can significantly benefit software development efforts by improving code quality and reducing development time.
Authors
- Eman Abdullah AlOmar (ORCID: https://orcid.org/0000-0003-1800-9268)
- Sukhdeep Singh (ORCID: https://orcid.org/0000-0002-8561-484X)
- Shanal Divyansh
- Pranjal Apoorva
- Anita Ershadi
- Hiral Makwana
Institutions
- Stevens Institute of Technology (US)
Publication Details
- Published
- 2025-04-05
- DOI
- https://doi.org/10.1109/icmi65310.2025.11139842
- Primary Topic
- Artificial Intelligence in Healthcare and Education
- Type
- article
- Field-Weighted Citation Impact
- 0.00