Automating Clean Architecture Conformance via AST-Based Code Smell Detection and Auto-Refactoring in Laravel Projects - Ahmad Fatih Hibatillah; Fitri Wulandari (Journal of Information System Research (JOSH), 2026)
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.