PMD - 有没有办法跟踪个人开发者的 PMD 投诉

发布于 2024-10-01 04:13:10 字数 79 浏览 0 评论 0 原文

是否有工具或插件可以跟踪 PMD、CheckStyle 和 PMD? Findbugs 为每个开发人员提供不合规报告

谢谢 韩国

Is there a tool or plugin to track PMD, CheckStyle & Findbugs noncompliance report for each developer

Thanks
KR

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

我很坚强 2024-10-08 04:13:10

似乎 Sonar 正是您所需要的

Sonar 是开源品质
管理平台,致力于
不断分析和测量
技术品质

它有不同的附加插件,但默认情况下它拥有所有您需要的 - checkstyle、pmd、findbugs。您所需要的只是下载,将其解压到某个地方,然后启动声纳。对于您的项目,您需要最少的 pom.xml (sonar 使用它来知道编译文件在哪里),然后使用命令执行 pom (就像我一样):

mvn cleancompilesonar:sonar

阅读更多内容 声纳项目文档页面。

还有一种方法可以将 Sonar 与 Eclipse 集成(但你需要有 Sonar ,Eclipse只会连接到它并获取报告,无论如何它很容易使用,因为您打开课程并看到与之相关的声纳注释,因此您可以修复它们)

这里是正在运行的声纳报告,您可以尝试并决定;)

Seems that Sonar is what you need

Sonar is an open source quality
management platform, dedicated to
continuously analyze and measure
technical quality

it has different additional plugins, but by default it has all that you need - checkstyle, pmd, findbugs. All that you need is just download, unpack it somewhere, start sonar. For your project you need minimal pom.xml (sonar uses it to know where compiled files are), and you execute you pom with command (as I do):

mvn clean compile sonar:sonar

Read more on documentation page of sonar project.

There is also a way to integrate Sonar with Eclipse (but you need to have Sonar, Eclipse just will connect to it and get reports, anyway it is easy to use because you open class and see sonar remarks related to it, so you can fix them)

Here are sonar reports in action, you can try and decide ;)

四叶草在未来唯美盛开 2024-10-08 04:13:10

我不知道有这样的工具,但我认为,考虑到时间,编写一个在技术上是可行的。

假设,这样的工具需要通过检查版本控制中的每个修订,在每个修订上运行 PMD / CheckStyle / FindBugs 来工作,然后将报告的违规中的“增量”归因于签入修订的人员。

然而,我怀疑使用这样的工具可能会带来严重的缺点。

首先,这样的工具实际上并不能提高代码质量,甚至不能比您现有的更好地量化代码质量问题。它所做的只是将责任归咎于个别团队成员。

这种指责很可能是不公平的。例如,事实上,PMD 和 FindBugs 经常将明显无害的事情标记为违规,或者是一个有相当大争议的问题。当你的团队中有人因引入此类违规行为而受到“谴责”时,他们会感到愤慨。

如果不小心,最终的结果将是团队士气丧失,团队成员将注意力集中在违规计数上,而不是努力推进项目。

同样,您不应该使用此类工具的报告来确定谁是最好/最差的开发人员。您很可能会得到错误的答案。

I'm not aware of such a tool, but I think it would be technically feasible to write one, given the time.

Hypothetically, such a tool would need to work by checking out each and every revision from version control, run the PMD / CheckStyle / FindBugs on each revision, and then ascribe the "deltas" in the reported violations to the person who checked in the revision.

However, I suspect that using a tool like could have serious downsides.

Firstly, such a tool doesn't actually improve code quality, or even quantify your code quality problems any better than you can already do. All it does it is to "point the finger of blame" at individual team members.

And it could well be that the finger pointing is unfair. For instance, it is a fact that PMD and FindBugs often flag things as violations when they are clearly harmless, or a matter of considerable debate. When someone on your team who gets "dinged" for introducing such violations, they are going to be justifiably aggrieved.

If you are not careful, the net result will be loss of team morale, and team members focusing on violation counts instead of working to progress the project.

Similarly, you shouldn't use reports from such a tool to figure out who your best / worst developers are. You are likely to get the wrong answer.

戏舞 2024-10-08 04:13:10

如果您使用版本控制系统,则可以使用责备/赞扬功能,该功能将逐行显示哪个开发人员最后接触过它。如果您使用的是好的 IDE,它应该能够使用信息注释您的装订线/边距。

If you are using a version control system, you can use the blame/praise function which will show you line-by-line which develper last touched it. If you are using a good IDE it should be able to annotate your gutter/margin with the information.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文