Code smell severity classification at class and method level with a single manually labeled imbalanced dataset - Santos, Fábio do Rosario; Duarte, Julio Cesar; Choren, Ricardo (Anais do Simpósio Brasileiro de Engenharia de Software (SBES); 2024: Anais do XXXVIII Simpósio Brasileiro de Engenharia de SoftwareDO - 10.5753/sbes.2024.2933, 2024)
Detecting code smells through machine learning (ML) poses challenges due to its unbalanced nature and potential interpretation bias. While previous studies focused on severity tended to categorize code smell’s specific types, this research aims to detect and classify code smell severity in a single dataset containing instances of code smells of four distinct types: God-class, Data-Class, Feature-Envy, and Long-Method. This study also explores the impact of applying data scaling, feature selection techniques, and ensemble methods to enhance ML models for the purpose above. The evaluation of two ensemble models on a combined dataset reveals that using data standardization techniques, ensemble methods, and Chi-square outperforms the result of other ensemble combinations, achieving 81.04% and 81.41% accuracy in the XGBoost and CatBoost models. Additionally, the CatBoost algorithm attains the highest accuracy at 80.67%, even without data preprocessing. Comparatively with the state-of-the-art, the results obtained, an accuracy of 85%, by the proposed approach in detecting the severity of code smells are promising and suggest improvements in approaches and techniques to enhance the effectiveness and reliability of models in real-world scenarios.