arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2403.17430cs.PL
收藏

带有“-Er”和“-Utils”后缀的 Java 类具有更高的复杂度

Java Classes with "-Er" and "-Utils" Suffixes Have Higher Complexity

Anna Sukhova, Alexey Akhundov, Efim Verzakov, Yegor Bugayenko

AI总结:

本研究通过分析212个开源GitHub仓库的13,861个Java类,验证了带有-Er/-Or和-Utils后缀的类因承担过多功能职责而具有更高复杂度的直觉,发现其复杂度指标平均值至少高出2.5倍。

摘要:

在面向对象编程语言中,存在一种观念,认为带有 -Er/-Or 和 -Utils 后缀的类是“代码异味”,因为它们承担了大量功能职责,变得臃肿且复杂,从而增加了代码维护难度。为验证这一直觉,我们分析了来自 212 个独特的开源 GitHub 仓库的 13,861 个 Java 类的复杂度和内聚性。我们发现,当存在这些后缀时,Cyclomatic Complexity 和 Cognitive Complexity 指标的平均值至少高出 2.5 倍。

英文摘要:

In object-oriented programming languages, a belief exists that classes with -Er/-Or and -Utils suffixes are "code smells" because they take over a lot of functional responsibility, turning out to be bulky and complicated, and therefore making it more difficult to maintain the code. In order to validate this intuition, we analyzed complexity and cohesion of 13,861 Java classes from 212 unique open-source GitHub repositories. We found out that average values of Cyclomatic Complexity and Cognitive Complexity metrics are at least 2.5 times higher when suffixes are present.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑