Dependencies between modules can trigger ripple effects when changes are made, making maintenance complex and costly, so minimizing these dependencies is crucial. Consequently, understanding what drives dependencies is important. One potential factor is code smells, which are symptoms in code that indicate design issues and reduce code quality. When multiple code smells interact through static dependencies, their combined impact on quality can be even more severe. While individual code smells have been widely studied, the influence of their interactions remains underexplored. In this study, we aim to investigate whether and how the distribution of static dependencies changes in the presence of code smell interactions. We conducted a dependency analysis on 116 open-source Java systems to quantify these interactions by comparing cases where code smell interactions exist and where they do not. Our results suggest that overall, code smell interactions are linked to a significant increase in total dependencies in 28 out of 36 cases, and that all code smells are associated with a consistent change direction (increase or decrease) in certain dependency types when interacting with other code smells. Consequently, this information can be used to support more accurate code smell detection and prioritization, as well as to develop more effective refactoring strategies.
翻译:模块间的依赖关系在代码变更时可能引发连锁反应,导致维护工作复杂且成本高昂,因此最小化这些依赖至关重要。相应地,理解依赖关系的驱动因素具有重要意义。代码异味是潜在因素之一,这类代码症状反映了设计缺陷并降低代码质量。当多个代码异味通过静态依赖关系相互作用时,它们对代码质量的综合影响可能更为严重。尽管单个代码异味已得到广泛研究,但其交互作用的影响仍未充分探索。本研究旨在探究代码异味交互是否存在以及如何改变静态依赖关系的分布。通过对116个开源Java系统进行依赖分析,我们通过比较存在代码异味交互与不存在交互的情况来量化这些相互作用。结果表明:总体而言,在36个案例中有28个案例显示代码异味交互与总依赖量的显著增加相关;且所有代码异味在与其他异味交互时,均与特定依赖类型呈现一致的变化方向(增加或减少)。因此,这些信息可用于支持更精确的代码异味检测与优先级排序,并有助于制定更有效的代码重构策略。