[英]Sonar plugins vs standalone sonar and quality profile
I'm using sonar with jenkins for continues integration and code analysis. 我正在使用带有jenkins的声纳进行持续集成和代码分析。 I learned that sonar by default includes
Checkstyle
, FindBugs
, JaCoCo
, PMD
altogether, so we don't need to configure any of the above plugins to a project. 我了解到声纳默认包括
Checkstyle
, FindBugs
, JaCoCo
, PMD
,因此我们不需要将任何上述插件配置到项目中。 But when I check the Quality Profile, there are two profiles named as Sonar way
with 113 rules and Sonar way with Findbugs
with 516. What does mean by there profiles? 但是,当我检查质量配置文件时,有两个配置文件,名为
Sonar way
,113条规则, Sonar way with Findbugs
,516条。有什么意思是什么意思? Why they have different rules? 为什么他们有不同的规则?
And, I have a requirement like, for some project, I need to configure Checkstyle only for another project may be Checkstyle with PMD, etc. Is it possible to do that? 并且,我有一个要求,例如,对于某些项目,我需要仅为另一个项目配置Checkstyle可能是带有PMD的Checkstyle等。是否可以这样做?
Sonar works by parsing the output of the external tools like Checkstyle
, FindBugs
, PMD
, etc. In short you don't need to configure the plugins, but you can specify the way Sonar reacts to violations in your code found by the plugins. Sonar通过解析
Checkstyle
, FindBugs
, PMD
等外部工具的输出来工作。简而言之,您不需要配置插件,但您可以指定Sonar对插件找到的代码中的违规行为作出反应的方式。
With Quality profile
you can set the rules for your project and modify them for your needs, eg line length by default is 80, but you can extend it for your project to 120 characters. 使用
Quality profile
您可以为项目设置规则并根据需要进行修改,例如,默认行长度为80,但您可以将项目扩展为120个字符。 If your coding style doesn't care about line length you can disable the rule. 如果您的编码样式不关心行长度,则可以禁用该规则。
Two default quality profiles gives you an option to decide to build the project with or without Findbugs
, which means that your build will or will not run Findbug tool. 两个默认质量配置文件为您提供了决定使用或不使用
Findbugs
来构建项目的选项,这意味着您的构建将运行或不运行Findbug工具。 Findbug
provides wider set of rules, but will slow down your build. Findbug
提供了更广泛的规则,但会降低您的构建速度。
To set a specific rules to specific projects you can check here 要为特定项目设置特定规则,您可以在此处查看
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.