简体   繁体   English

Sonar插件与独立声纳和质量配置文件

[英]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. 了解到声纳默认包括CheckstyleFindBugsJaCoCoPMD ,因此我们不需要将任何上述插件配置到项目中。 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通过解析CheckstyleFindBugsPMD等外部工具的输出来工作。简而言之,您不需要配置插件,但您可以指定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.

相关问题 Sonar Eclipse插件使用错误的质量配置文件作为Sonar服务器 - Sonar Eclipse plugin using the wrong quality profile as Sonar server 在Sonar 5.2中无法导入质量配置文件规则集 - Unable to import Quality Profile Ruleset in Sonar 5.2 在 SonarQube 中,安全审查的“声纳方式”质量配置文件的可靠性如何? - In SonarQube, how reliable is the 'Sonar way' quality profile for security reviews? 是否可以从分析中停用“声纳方式”质量配置文件? - Is it possible to deactivate 'Sonar way' quality profile from an analysis? 声纳不下载插件 - Sonar does not download plugins 运行声纳配置文件时出错 - Error running sonar profile Jenkins Sonar Scanner vs Maven声纳:声纳目标 - Jenkins Sonar Scanner vs Maven sonar:sonar goal 在 SonarQube 中,为什么“Sonar way”质量配置文件不包含来自 SonarJava 存储库的所有规则 - in SonarQube, why 'Sonar way' quality profile doesn't contain all the rules from SonarJava repository 声纳,一个项目的一个配置文件 - Sonar, one profile for one project 设置本地声纳(服务器)与让所有插件在Eclipse中使用checkstyles,pmd,findbugs - Setting up a local Sonar (server) vs having all the plugins checkstyles,pmd,findbugs in eclipse
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM