3

Issue

I am using SonarQube 7.9.1. I have Quality Profile containing ~450 active rules for Java code. There are exporters for FindBugs, PMD and Checkstyle in SonarQube, but they are not exporting all available rules. After export ~20 rules are missing. What can be the cause of that?

Example of missing rule: "Unnecessary imports should be removed". It seems strange, because both Checkstyle and PMD have such rule available.

Question

Is it possible to export all rules defined in SonarQube Quality Profile to Checkstyle, PMD and SpotBugs rule files?

4

1 回答 1

2

我猜,您启用了 SonarQube 规则RSPEC-1128 应该删除不必要的导入,现在您希望在 Checkstyle 规则集文件中启用 UnusedImportsCheck。我不认为出口商以这种方式工作。它只需要指定工具的所有启用规则并将它们导出到文件中。这意味着如果您启用 UnusedImportsCheck Checktyle 规则,我确定它会在导出的文件中。

是否可以将 SonarQube Quality Profile 中定义的所有规则导出到 Checkstyle、PMD 和 SpotBugs 规则文件?

可以导出:

  • Checkstyle 规则到 Checktyle 规则集文件
  • PMD 规则到 PMD 规则集文件
  • ETC

无法将 SonarQube 规则导出为不同的工具规则,例如:

  • SQUID 规则到 Checktyle 规则集文件
于 2019-11-28T09:19:45.510 回答