arrow
Return

Python code smells detection using conventional machine learning models

delete2023-05-29
delete7
delete
OA
AI
R
Rana Sandouka
H
Hamoud Aljamaan *
DOI:10.7717/peerj-cs.1370delete
deleteOriginal
deleteShare
deleteSave
View PDF
Abstract

Abstract

En 中文
Code smells are poor code design or implementation that affect the code maintenance process and reduce the software quality. Therefore, code smell detection is important in software building. Recent studies utilized machine learning algorithms for code smell detection. However, most of these studies focused on code smell detection using Java programming language code smell datasets. This article proposes a Python code smell dataset for Large Class and Long Method code smells. The built dataset contains 1,000 samples for each code smell, with 18 features extracted from the source code. Furthermore, we investigated the detection performance of six machine learning models as baselines in Python code smells detection. The baselines were evaluated based on Accuracy and Matthews correlation coefficient (MCC) measures. Results indicate the superiority of Random Forest ensemble in Python Large Class code smell detection by achieving the highest detection performance of 0.77 MCC rate, while decision tree was the best performing model in Python Long Method code smell detection by achieving the highest MCC Rate of 0.89.
Keywords:
Python
Code smell
Detection
Machine learning
Large class
Long method
AI Summary

AI Summary

Key information extracted from the uploaded paper, including a brief overview, abstract, background, key highlights, visual analysis, and future outlook.

Journal

PeerJ Computer Science cover
PeerJ Computer Science
IF:
2.5
Papers:
3.4K
Citations:
6.9K

Organization

No organization information available
Cited Papers

Cited Papers

Comparing and experimenting machine learning techniques for code smell detection
err2015-06-06
err277
PREAI
errFontana, Francesca Arcelli; Mantyla, Mika V.; Zanoni, Marco; Marino, Alessandro
errShare
errSave
err
IF0
err
err0
PREAI
err
errShare
errSave
BDTEX: A GQM-based Bayesian approach for the detection of antipatterns
err2011-04-01
err143
PREAI
errKhomh, Foutse; Vaucher, Stephane; Gueheneuc, Yann-Gael; Sahraoui, Houari
errShare
errSave
Code smells and refactoring: A tertiary systematic review of challenges and observations
err2020-09-01
err102
errOAAI
errLacerda, Guilherme; Petrillo, Fabio; Pimenta, Marcelo; Gueheneuc, Yann Gael
errShare
errSave
In Vivo Analysis of the Role of O-Glycosylations of Von Willebrand Factor
err2012-05-17
err0
errOAAI
errIdinath Badirou; Mohamad Kurdi; Paulette Legendre; Julie Rayes; Marijke Bryckaert; Caterina Casari; Peter J. Lenting; Olivier D. Christophe; Cecile V. Denis
errShare
errSave
Code smell detection by deep direct-learning and transfer-learning?
err2021-06-01
err51
errOAAI
errSharma, Tushar; Efstathiou, Vasiliki; Louridas, Panos; Spinellis, Diomidis
errShare
errSave
On the diffuseness and the impact on maintainability of code smells: a large scale empirical investigation
err2017-08-07
err193
errOAAI
errPalomba, Fabio; Bavota, Gabriele; Di Penta, Massimiliano; Fasano, Fausto; Oliveto, Rocco; De Lucia, Andrea
errShare
errSave
Code smells and their collocations: A large-scale experiment on open-source systems
err2018-10-01
err24
PREAI
errWalter, Bartosz; Fontana, Francesca Arcelli; Ferme, Vincenzo
errShare
errSave
researcher View more