AI & ML
A GNN-Based Approach for Code Smell Detection and Refactoring Opportunity Identification
arXiv cs.SE0 views
arXiv:2511.12069v5 Announce Type: replace Abstract: Code smells indicate latent design or implementation problems that may negatively affect software maintainability. Over the past decades, numerous approaches have been proposed for code smell refactoring, including those based on software metrics, predefined rules, machine learning/deep learning (ML/DL), and, more recently, large language models (LLMs). However, traditional metric- and rule-based approaches rely heavily on manually defined criteria, while ML/DL approaches are often constrained by the availability of training data and the design of model architectures. Although LLMs provide advanced code understanding capabilities, they typically incur substantial computational and time costs, particularly when applied to large-scale software systems. In this study, we propose a graph-based deep learning approach for code smell refactoring. Specifically, we construct code graphs at both the class and method levels and employ graph- and node-level classification to detect code smells and identify corresponding refactoring opportunities for three representative code smells: Long Method, Large Class, and Feature Envy. The proposed approach is trained and evaluated using SACS, a large-scale open-source dataset constructed through a semi-automated process. In the experiments, we implement the proposed approach using three representative GNN architectures: GCN, GraphSAGE, and GAT. We further compare its performance with traditional refactoring approaches, an existing deep learning-based approach, and four representative lightweight LLMs. Experimental results show that the proposed approach outperforms the compared approaches across all evaluated code smell refactoring tasks, demonstrating that it provides both superior performance and greater efficiency.
Source:https://arxiv.org/abs/2511.12069PreviousBigCodeArena: Unveiling More Reliable Human Preferences in Code Generation via ExecutionNextFrom Conversation to Evaluation: Benchmarking LLMs on Development Knowledge via SimpleDevQA
Related posts
Your Manager's Manager Has Booked a Skip Level Meeting With You
0dev.to

How to Make a Character Reference Sheet with AI (Prompts Included)
0dev.to Design
How Virtual Assistants Help Businesses Manage Their Work More Efficiently
0dev.to Productivity
DiffusionSSD: Achieving Extreme Visual Compression with Dual-stage Diffusion and Cross-level Near-Data Processing
0arXiv eess.IV
D2ToF: One-Step Diffusion for Depth Super-Resolution from Lightweight Single-Photon LiDAR Waveforms
0arXiv eess.IV
Few-Shot Open-Set Hyperspectral Pixel-Wise Classification with Spatial Aware Label Propagation
0arXiv eess.IV