AI-Driven Code Refactoring: Using Graph Neural Networks to Enhance Software Maintainability

Gopichand Bandarupalli
4/14/2025
cs.AIcs.LGcs.SE

No confident code implementation found for this paper. 3 possible matches can be shown below.

Abstract

This study explores Graph Neural Networks (GNNs) as a transformative tool for code refactoring, using abstract syntax trees (ASTs) to boost software maintainability. It analyzes a dataset of 2 million snippets from CodeSearchNet and a custom 75000-file GitHub Python corpus, comparing GNNs against rule-based SonarQube and decision trees. Metrics include cyclomatic complexity (target below 10), coupling (target below 5), and refactoring precision. GNNs achieve 92% accuracy, reducing complexity by 35% and coupling by 33%, outperforming SonarQube (78%, 16%) and decision trees (85%, 25%). Preprocessing fixed 60% of syntax errors. Bar graphs, tables, and AST visuals clarify results. This offers a scalable AI-driven path to cleaner codebases, which is crucial for software engineering.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 3 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{bandarupalli2025aidriven,
  title  = {AI-Driven Code Refactoring: Using Graph Neural Networks to Enhance Software Maintainability},
  author = {Gopichand Bandarupalli},
  year   = {2025},
  eprint = {2504.10412},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2504.10412v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2504.10412.svg)](https://codeofpaper.com/paper/2504.10412)

Discussion