1

我正在尝试做的事情

我正在尝试从SonarQube(7.9.1)质量配置文件中导出FindBugs规则并在本地SpotBugs中使用它们。我希望在 SonarQube 服务器和本地 SpotBugs 中具有相同的规则。 我使用 SonarQube 的 FindBugs 导出器导出了静态分析规则。然后我在我的机器上使用了 SpotBugs 中创建的 xml:

<FindBugsFilter>
  <Match>
    <Bug pattern="SA_LOCAL_SELF_COMPARISON"/>
  </Match>
  <Match>
    <Bug pattern="UG_SYNC_SET_UNSYNC_GET"/>
  </Match>
  <Match>
    <Bug pattern="IC_SUPERCLASS_USES_SUBCLASS_DURING_INITIALIZATION"/>
  </Match>
  <!-- Other rules -->
</FindBugsFilter>

问题

Sonar 和 SpotBugs 中报告的错误是不同的。在 SpotBugs 中缺少一些规则。是否有可能某些错误模式无法被 SpotBug 识别,因为它们是 FindBugs 模式?
我找到了 FindBugs 和 SpotBugs 的芽描述。大多数情况下它们是重叠的,但有些错误只存在于前者或后者中:
SpotBugs Bug Descriptions
FindBugs Bug Descriptions

问题

FindBugs 过滤器中使用的所有错误描述都适用于 SpotBugs 吗?

4

0 回答 0