简体   繁体   English

指标、气味:如何在我的旧产品 java 存储库中找到最长的(代码行)方法?

[英]Metrics, smells: How to find longest (in lines of code) methods in my legacy product java repo?

What is the simplest way to find longest (in terms of lines of code) methods in a legacy java code base?在遗留 Java 代码库中找到最长(就代码行而言)方法的最简单方法是什么?

We use gradle and IntelliJ IDEA so ideally a plugin for one of these.我们使用 gradle 和 IntelliJ IDEA,因此理想情况下是其中之一的插件。

您可以尝试JArchitect ,它提供了许多开箱即用的代码气味规则,您可以使用用于创建规则的代码查询语言 CQLinq 轻松自定义规则。

I suggest that you do a bit of research/googling on "static code analysis" and you'll soon find things like pmd and findbugs .我建议您对“静态代码分析”进行一些研究/谷歌搜索,您很快就会找到诸如pmdfindbugs 之类的东西。

For tracking these reports over time there's enterprise solutions like sonarqube为了随着时间的推移跟踪这些报告,有像sonarqube这样的企业解决方案

All of these have gradle integration所有这些都有gradle集成

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM