SonarQube是否可以代替Checkstyle,PMD,FindBugs? [英] Is SonarQube Replacement for Checkstyle, PMD, FindBugs?

查看:760
本文介绍了SonarQube是否可以代替Checkstyle,PMD,FindBugs?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们从头开始研究一个Web项目,并研究以下静态代码分析工具。

We are working on a web project from scratch and are looking at the following static code analysis tools.


  • Conventions(Checkstyle)

  • 不良做法(PMD)

  • 潜在错误(FindBugs)

该项目基于Maven构建。而不是为此目的使用多个工具,而是在寻找一个灵活的解决方案,并遇到了SonarQube。

The project is built on Maven. Instead of using multiple tools for the purpose, I was looking at a single flexible solution and came across SonarQube.

是的,我们可以从Checkstyle,PMD中获得结果是真的吗和SonarQube的Findbugs?

Is it true that we can achieve the results from Checkstyle, PMD and Findbugs with SonarQube?

推荐答案

Sonar将运行CheckStyle,FindBugs和PMD,以及其他一些插件,例如Cobertura(代码覆盖率) Java项目默认情况下。但是,主要的附加值是将历史记录存储在数据库中。然后,您可以查看趋势。您是在改进的代码库,还是相反?只有具有内存的工具才能告诉您。

Sonar will run CheckStyle, FindBugs and PMD, as well as a few other "plugins" such as Cobertura (code coverage) by default for Java projects. The main added value, however, is that it stores the history in a database. You can then see the trend. Are you improving the code base or are you doing the opposite? Only a tool with memory can tell you that.

您应该在CI系统中运行Sonar,以便即使需要一些时间才能执行的事情(例如CPD –复制粘贴)检测器)可以运行。您将拥有自己的历史记录。例如,使用Eclipse插件,您会更快地检测到违规行为-这很好 –但是,如果启动时间太长,或者运行质量较差的插件,您将被诱惑减少运行频率(例如跳过CPD或跳过代码覆盖率分析)。而且您将没有历史记录。

You should run Sonar in your CI system so that even things that take some time to execute (such as CPD – copy paste detector) can run. And you'll have your history. Whereas with an Eclipse plugin, for example, you'll detect violations sooner – which is great – but you will be tempted to run it less often if it starts taking too long, or run less "quality plugins" (such as skipping CPD or skipping code coverage analysis). And you won't have history.

Sonar还会生成 <仪表盘样式的视觉报告。这使得它很容易掌握。使用Jenkins中的Sonar,您可以向开发人员和您的管理人员展示过去几周和几个月来执行的工作对代码库质量的影响。

Also, Sonar generates visual reports, "Dashboard" style. Which makes it very easy to grasp. With Sonar in Jenkins, you'll be able to show developers and your management the effects of the work that was performed on the quality of the code base over the last few weeks and months.

这篇关于SonarQube是否可以代替Checkstyle,PMD,FindBugs?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆