Automating Clean Architecture Conformance via AST-Based Code Smell Detection and Auto-Refactoring in Laravel Projects


  • Ahmad Fatih Hibatillah Universitas Islam Negeri Sunan Kalijaga Yogyakarta, Yogyakarta, Indonesia
  • Fitri Wulandari * Mail Universitas Islam Negeri Sunan Kalijaga, Yogyakarta, Indonesia
  • (*) Corresponding Author
Keywords: Auto-Refactoring; Clean Architecture; Code Smell; Laravel; Visual Studio Code Extension

Abstract

While MVC frameworks like Laravel accelerate development, their inherent architectural flexibility frequently induces structural code smells such as fat controllers and direct database access that inevitably lead to architectural erosion and technical debt. This research proposes a Visual Studio Code (VS Code) extension designed to automate Clean Architecture conformance through real-time Abstract Syntax Tree (AST) parsing. Utilizing the Tree-sitter parsing system, the extension continuously evaluates the codebase to detect architectural violations. Beyond passive diagnostics, the tool facilitates interactive auto-refactoring. To ensure business logic integrity during migration, the refactoring engine employs deterministic AST node transformations that safely isolate data access operations into dedicated service layers without altering operational behavior. Evaluation through Black-Box Testing confirmed high detection accuracy across predefined architectural anti-patterns. Furthermore, User Acceptance Testing (UAT) conducted with industry experts yielded an average acceptance score of 4.18 out of 5.00. Ultimately, this AST-based approach provides a pragmatic solution to actively prevent architectural decay, mitigate technical debt, and significantly enhance the long-term maintainability of Laravel-based projects. The main contribution of this research is the transition of architectural code smell mitigation from a passive diagnostic reporting mechanism into an active, real-time, AST-driven auto-refactoring tool directly integrated within the developer's workspace.

Downloads

Download data is not yet available.

References

S. Rochimah, T. R. Hadiningrum, B. D. Mardiana, D. O. Siahaan, J. A. Rizky, and M. S. Ary, “A Maintainability Framework to Ensure the Software Quality in Object-Oriented Programming,” IEEE Access, vol. 13, pp. 195796–195821, 2025, doi: 10.1109/ACCESS.2025.3633265.

R. Li, P. Liang, M. Soliman, and P. Avgeriou, “Understanding software architecture erosion: A systematic mapping study,” Mar. 01, 2022, John Wiley and Sons Ltd. doi: 10.1002/smr.2423.

A. Tornhill and M. Borg, “Code Red: The Business Impact of Code Quality – A Quantitative Study of 39 Proprietary Production Codebases,” 2022. [Online]. Available: https://arxiv.org/abs/2203.04374

“Laravel - The clean stack for Artisans and agents.” Accessed: Apr. 25, 2026. [Online]. Available: https://laravel.com/

“PHP: Introduction - Manual.” Accessed: Apr. 25, 2026. [Online]. Available: https://www.php.net/manual/en/introduction.php

A. F. Rahmawati and Y. A. Susetyo, “Analisis Quality Code Menggunakan Sonarqube Dalam Suatu Aplikasi Berbasis Laravel,” IT-Explore: Jurnal Penerapan Teknologi Informasi dan Komunikasi, vol. 2, no. 2, pp. 99–103, 2023, doi: 10.24246/itexplore.v2i2.2023.pp99-103.

M. Y. Rangkuti, H. R. Ilhamsyah, R. Z. Mutaqin, and M. L. Khoirullah, “Analisis Penerapan Arsitektur Model–View–Controller (MVC) pada Pengembangan Aplikasi Web Berbasis Laravel,” Jurnal Teknologi Sistem Informasi, vol. 3, no. 2, pp. 12–21, 2022.

B. Moloudi, “Optimizing Architecture in iOS Development: A Comparative Study of MVVM and VIPER using SwiftUI,” Master’s thesis, Interactive Technologies, Turku University of Applied Sciences, Turku, Finland, 2025.

A. Rio and F. Brito e Abreu, “PHP code smells in web apps: Evolution, survival and anomalies,” J. Syst. Softw., vol. 200, p. 111644, 2023, doi: 10.5281/zenodo.

M. Fowler, K. Beck, J. Brant, W. Opdyke, and D. Roberts, Refactoring: Improving the Design of Existing Code, 2nd ed. Boston, MA, USA: Addison-Wesley, 2018.

N. S. Filho, “Comparative Analysis between Cognitive Complexity and Cyclomatic Complexity in Software Development,” Leaders.Tec.Br, vol. 2, no. 7, doi: 10.5281/zenodo.14879076.

R. Hu, “An Automated Approach to Check Software Architecture Erosion,” Master’s thesis, Dept. Math. Comput. Sci., Eindhoven University of Technology, Eindhoven, Netherlands, 2023.

R. C. Martin, Clean Architecture: A Craftsman's Guide to Software Structure and Design. Boston, MA, USA: Prentice Hall, 2017.

N. S. P. K. Yadati, “Architecture Design (MVVM + Clean Architecture),” Journal of Artificial Intelligence, Machine Learning and Data Science, vol. 1, no. 3, pp. 703–706, Sep. 2023, doi: 10.51219/jaimld/naga-satya-praveen-kumar-yadati/177.

Hamzan Wadi, Kasmawi, and Muhammad Asep Subandri, “Penggunaan Software Metrics Dan Abstract Syntax Tree Untuk Mendeteksi Code Smell Pada Bahasa Pemrograman Python,” JEKIN - Jurnal Teknik Informatika, vol. 5, no. 1, pp. 61–69, Jan. 2025, doi: 10.58794/jekin.v5i1.900.

A. Nuraminah and A. Ammar, “Damerau-Levenshtein Distance Algorithm Based on Abstract Syntax Tree to Detect Code Plagiarism,” Scientific Journal of Informatics, vol. 11, no. 1, pp. 11–20, Dec. 2023, doi: 10.15294/sji.v11i1.48064.

“Implementing Parser and PSI | IntelliJ Platform Plugin SDK.” Accessed: Apr. 11, 2026. [Online]. Available: https://plugins.jetbrains.com/docs/intellij/implementing-parser-and-psi.html

A. Sergeyuk, I. Zakharov, E. Koshchenko, and M. Izadi, “Human-AI Experience in Integrated Development Environments: A Systematic Literature Review,” Jan. 2026, doi: 10.1007/s10664-025-10793-0.

“Static Code Analysis: Tools and Best Practices | Cycode.” Accessed: Apr. 06, 2026. [Online]. Available: https://cycode.com/blog/static-code-analysis/

“Extension API | Visual Studio Code Extension API.” Accessed: Apr. 06, 2026. [Online]. Available: https://code.visualstudio.com/api

S. Kushwah, C. Bansal, S. Rathore, V. Kate, D. Bargal, and D. Vishwakarma, TypeScript: An Open-Source Programming Language with Options for Robust Development and Large-Scale Applications. 2024. doi: 10.1109/ACROSET62108.2024.10743426.

M. Alharbi and M. Alshayeb, “A Comparative Study of Automated Refactoring Tools,” IEEE Access, vol. 12, pp. 18764–18781, 2024, doi: 10.1109/ACCESS.2024.3361314.

B. Nugroho, N. F. Azhar, and P. C. Subekti, “Refactoring Aplikasi XYZ Menggunakan Pendekatan Clean Architecture,” Information System Journal, vol. 7, no. 01, pp. 20–33, Jun. 2024, doi: 10.24076/infosjournal.2024v7i01.1579.

“Tree-sitter: An incremental parsing system for programming tools.” Accessed: Apr. 07, 2026. [Online]. Available: https://tree-sitter.github.io/tree-sitter/

J. J. Wijadi, B. Ghiffar, and I. B. K. Manuaba, “A Study on the Performance of WebAssembly Versus JavaScript in an SVG Editor Environment,” in 2024 International Symposium on Parallel Computing and Distributed Systems (PCDS), 2024, pp. 1–5. doi: 10.1109/PCDS61776.2024.10743854.

A. Supriyatna and D. Puspitasari, “Implementation of Extreme Programming Method in Web Based Digital Report Value Information System Design,” IJISTECH (International Journal of Information System & Technology), vol. 5, no. 1, pp. 67–75, 2021, doi: 10.30645/ijistech.v5i1.116.

T. Haryati, W. Handini, and Y. M. Aprita, “Penerapan Extreme Programming dalam Pembangunan Sistem Informasi Pembayaran Tagihan PAM pada PAMDES Margakaya Sejahtera Karawang,” Jurnal Penelitian Inovatif, vol. 4, no. 1, pp. 129–136, Feb. 2024, doi: 10.54082/jupin.278.

D. J. C. Sihombing, “Enhancing Project Visibility: A Study on Construction Project Dashboard Development with Extreme Programming,” Informatika dan Sains, vol. 14, no. 01, pp. 45–53, 2024, doi: 10.54209/infosains.v14i01.3739.

S. Astiti, “RESOLUSI : Rekayasa Teknik Informatika dan Informasi Penerapan Metode Extreme Programming Pada Rancang Bangun Website Company Profile,” Media Online, vol. 3, no. 3, pp. 114–124, 2023, [Online]. Available: https://djournals.com/resolusi

I. G. B. Premana Putra, M. Sudarma, and I. B. G. Manuaba, “Penerapan Metode Extreme Programming pada Rancang Bangun Sistem Analisis Sentimen Portal Berita,” Jurnal Teknologi Informasi dan Ilmu Komputer, vol. 10, no. 6, pp. 1369–1378, Dec. 2023, doi: 10.25126/jtiik.2023106904.

M. T. Abdillah, I. Kurniastuti, F. A. Susanto, and F. Yudianto, “Implementasi Black Box Testing dan Usability Testing pada Website Sekolah MI Miftahul Ulum Warugunung Surabaya,” Jurnal Ilmu Komputer dan Desain Komunikasi Visual, vol. 8, no. 1, pp. 234–242, 2023, doi: 10.55732/jikdiskomvis.v8i1.897.

M. Hennink and B. N. Kaiser, “Sample sizes for saturation in qualitative research: A systematic review of empirical tests,” Soc. Sci. Med., vol. 292, p. 114523, 2022, doi: https://doi.org/10.1016/j.socscimed.2021.114523.

S. K. Ahmed, “Sample size for saturation in qualitative research: Debates, definitions, and strategies,” Journal of Medicine, Surgery, and Public Health, vol. 5, p. 100171, 2025, doi: https://doi.org/10.1016/j.glmedi.2024.100171.

Sugiyono, Metode Penelitian Kuantitatif, Kualitatif, dan R&D. Bandung: Alfabeta, 2013.


Bila bermanfaat silahkan share artikel ini

Berikan Komentar Anda terhadap artikel Automating Clean Architecture Conformance via AST-Based Code Smell Detection and Auto-Refactoring in Laravel Projects

Dimensions Badge
Article History
Submitted: 2026-07-05
Published: 2026-07-21
Abstract View: 0 times
PDF Download: 0 times
How to Cite
Hibatillah, A., & Wulandari, F. (2026). Automating Clean Architecture Conformance via AST-Based Code Smell Detection and Auto-Refactoring in Laravel Projects. Journal of Information System Research (JOSH), 7(4), 1174-1183. https://doi.org/10.47065/josh.v7i4.10618
Issue
Section
Articles