AI4SE for CI/CD: Explainable Code Smell Risk Analysis
Abstract
Continuous Integration and Continuous Delivery (CI/CD) pipelines accelerate software evolution but complicate the timely assessment of structural degradation. While code smells effectively indicate maintainability risks, their detection remains largely confined to isolated static analysis rather than being actively integrated into continuous workflows. To address this gap, we propose an explainable AI-driven approach for code smell classification designed specifically for software quality risk analysis in CI/CD environments. Using structural metrics related to complexity, coupling, and cohesion, we train a Random Forest model to classify four prevalent smells: Blob, Long Method, Feature Envy, and Data Class. Evaluated on labeled Java systems, our approach successfully captures the structural patterns indicative of software decay, achieving 82% accuracy and a 0.86 macro F1-score. Beyond raw performance, we operationalize these classifications as interpretable risk indicators within a prototype CI/CD pipeline, prioritizing human-centered evaluation. Ultimately, this work advances the AI for Software Engineering (AI4SE) domain by demonstrating how explainable machine learning can practically augment continuous quality assurance in agile development.