在 SonarQube 中,为什么 'Sonar way' 质量配置文件不包含来自 SonarJava 存储库的所有规则

in SonarQube, why 'Sonar way' quality profile doesn't contain all the rules from SonarJava repository

我公司使用 SonarQube 已经有一段时间了,现在我们安装了最新的 SonarQube verzion 6.4,我们想升级我们正在使用的质量配置文件。

据我所知,不再需要使用 FindBugs、PMD 和 Checkstyle 插件,因为来自 SonarJava 插件的规则包含来自其他插件的所有规则。

我想使用 'Sonar way' 内置配置文件,但我注意到它只包含 SonarJava 存储库中所有规则的子集。 Sonar 方式有 292 条规则,SonarJava 规则库有 427 条。我注意到 'Sonar way'.

中缺少一些重要规则

问题是:

  1. 为什么 'Sonar way' 不包含所有 SonarJava 规则。
  2. 创建包含来自 SonarJava 存储库的所有规则的配置文件并使用此配置文件是否有一些缺点?

Why doesn't 'Sonar way' contain all SonarJava rules.

因为一些规则是:

  • 限制太多 - 不适用于许多类型的应用程序,应在团队讨论后启用
  • 互斥(例如:RSPEC-1105 says that opening { character should be at the same line and RSPEC-1106 应该换行)
  • 它们仅在使用某些技术(JAVA 8、Spring 框架、jUnit 框架等)时适用

Sonar way 包含部分规则而非全部规则的几个原因。它导致更多的人可以使用默认的规则集而不会感到沮丧。

Is there some drawback in creating a profile that contains all rules from SonarJava repository, and using this profile?

您可以创建新的质量配置文件并使用批量操作启用所有规则。阅读更多:https://docs.sonarqube.org/latest/instance-administration/quality-profiles/