•  
  •  
 

Communications of the IIMA

Abstract

Software metrics play a central role in assessing and managing the quality of software systems providing quantitative insights into attributes such as complexity, reliability, rigidity, modifiability and maintainability. Among these, maintainability is particularly critical, as it directly influences the ease of system evolution, long-term sustainability, and overall cost effectiveness. Despite the widespread use of metric-based maintainability measurement algorithms, capturing a value that reflects the maintainability situation of software source code remains a challenging task, especially in the presence of design deficiencies such as code smells. To measure changes in maintainability, this study experimentaly characterises the relationship between code smells and maintainability. Four commonly studied code smells—Long Method, Long Parameter List, Feature Envy, and Refused Bequest—were systematically injected into open-source codebases derived from Apache Commons Lang. The modified systems were then evaluated using SonarQube, enabling a quantitative assessment of how these injected design deficiencies affect maintainability metrics. To have a comparative result set the Microsoft Maintainability Index algorithm was implemented into a tool to evaluate the same code base. The results from these approaches were combined into a structured dataset capturing the impact of different code smells across multiple measurement techniques. The analysis reveals notable discrepancies among existing maintainability algorithm, particularly regarding their sensitivity to specific types of code smells, which contrasts with expectations derived from prior literature, inconsistent maintainability degradation, ranking inconsistency, little or no reaction to some code smell. To address these limitations, we proposes a novel maintainability evaluation algorithm designed to better reflect the nuanced effects of structural and object-oriented design issues, bearing in mind not just the presence of code smell but the distribution of these smells. The proposed algorithm demonstrates improved alignment with observed patterns of maintainability degradation compared to traditional indices. This work contributes (i) A reproducible methodology for systematically evaluating maintainability degradation, (ii) a comparative analysis of widely used maintainability metrics, and (iii) a novel algorithm that enhances the accuracy of maintainability assessment in the presence of code smells, also the proposed algorithm showed high sensitivity and low sensitivity to some particular smells, it also showed that the maintainability value are sometimes clustered within a very short range of numbers irrespective of the number of smell injected.

Keywords: Code-smell, Maintainability index, Software-quality-metric, Feature envy, SonarQube.

Share

COinS