The presence of source code that is no longer needed is a handicap to project maintainability. The larger and longer-lived the project, the higher the chances of accumulating dead code in its different forms. Manually detecting unused code is time-consuming, tedious, error-prone, and requires a great level of deep knowledge about the codebase. In this paper, we examine the kinds of dead code (specifically, oxbow code) that can appear in Erlang projects, and formulate rules to identify them with high accuracy. We also present an open-source static analyzer that implements these rules, allowing for the automatic detection and confident removal of oxbow code in Erlang codebases, actively contributing to increasing their quality and maintainability.
翻译:不再需要源代码的存在是预测可维护性的一个障碍。 项目越大、时间越长,以不同形式积累死代码的可能性就越大。 手动检测未使用的代码耗时、乏味、容易出错,需要对代码库有高度的深入了解。 在本文中,我们检查了Erlanng项目中可能出现的死代码的类型(具体来说是牛鲍代码 ), 并制定规则, 以便非常精确地识别这些代码。 我们还提出了一个开放源静态分析器, 用于执行这些规则, 允许在Erlan 代码库中自动检测并自信地移除牛标码, 积极帮助提高它们的质量和可维护性。