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

PyExamine:一个全面、无偏见的Python代码坏味检测工具

PyExamine A Comprehensive, UnOpinionated Smell Detection Tool for Python

Karthik Shivashankar, Antonio Martini

AI总结:

PyExamine是一个全面的Python代码坏味检测工具,通过架构、结构和代码级三个层级分析49个指标,在7个项目中取得高检测准确率,并在183个项目中验证了坏味普遍性。

摘要:

Python在各个领域的广泛采用导致了日益复杂的代码库,给维护代码质量带来了挑战。尽管许多工具试图应对这些挑战,但它们在提供全面分析能力或考虑Python特定上下文方面往往存在不足。PyExamine通过一种跨多个分析层级的代码坏味检测方法解决了这些关键限制。PyExamine架构通过三个独立但相互关联的层级实现了对代码质量的详细检查:架构模式、结构关系和代码级实现。这种方法允许检测和分析49个不同的指标,为开发者提供对其代码库健康状况的理解。这些指标涵盖了代码组织的所有层级,从高层架构问题到细粒度的实现细节。通过对7个不同项目的评估,PyExamine实现了以下检测准确率:代码级坏味91.4%,结构级坏味89.3%,架构级坏味80.6%。这些结果进一步通过广泛的用户反馈和专家评估得到了验证,证实了PyExamine能够在所有代码组织层级上以高召回率识别潜在问题的能力。此外,我们还使用PyExamine分析了不同类型坏味的普遍性,涵盖了从小型实用工具到大规模企业应用的183个不同的Python项目。PyExamine将全面分析、Python特定检测和高可定制性独特结合,使其成为寻求提升代码质量实践的个人开发者和大型团队的宝贵资产。

英文摘要:

The growth of Python adoption across diverse domains has led to increasingly complex codebases, presenting challenges in maintaining code quality. While numerous tools attempt to address these challenges, they often fall short in providing comprehensive analysis capabilities or fail to consider Python-specific contexts. PyExamine addresses these critical limitations through an approach to code smell detection that operates across multiple levels of analysis. PyExamine architecture enables detailed examination of code quality through three distinct but interconnected layers: architectural patterns, structural relationships, and code-level implementations. This approach allows for the detection and analysis of 49 distinct metrics, providing developers with an understanding of their codebase's health. The metrics span across all levels of code organization, from high-level architectural concerns to granular implementation details. Through evaluation on 7 diverse projects, PyExamine achieved detection accuracy rates: 91.4\% for code-level smells, 89.3\% for structural smells, and 80.6\% for architectural smells. These results were further validated through extensive user feedback and expert evaluations, confirming PyExamine's capability to identify potential issues across all levels of code organization with high recall accuracy. In additional to this, we have also used PyExamine to analysis the prevalence of different type of smells, across 183 diverse Python projects ranging from small utilities to large-scale enterprise applications. PyExamine's distinctive combination of comprehensive analysis, Python-specific detection, and high customizability makes it a valuable asset for both individual developers and large teams seeking to enhance their code quality practices.

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

↑