简体   繁体   English

将FindBugs自定义规则转换为SonarQube

[英]Convert FindBugs custom rule to SonarQube

Last year I wrote a custom FindBugs rule with requirements as described in this Stackoverflow post . 去年,我写了一个自定义FindBugs规则,其要求与此Stackoverflow帖子中所述相同 I would like to write this rule using the new SonarQube Java rules. 我想使用新的SonarQube Java规则编写此规则。 I located general custom rule documentation on SonarQube's site which links to samples, etc. 在SonarQube的站点上找到了常规的自定义规则文档,文档链接到示例等。

Is there documentation describing how to convert a custom FindBugs rule written in Java to SonarQube format? 是否有文档描述如何将用Java编写的自定义FindBugs规则转换为SonarQube格式? Given the number of rules the SonarQube team has converted, I was hoping there might be basic guidance to use as a starting point, but I haven't located anything in my Google searching. 鉴于SonarQube团队已转换的规则数量,我希望可以有一些基本的指导作为起点,但是我在Google搜索中没有找到任何内容。

The hardest part about rewriting a FindBugs rule in a SonarQube plugin is understanding what the rule does. 在SonarQube插件中重写FindBugs规则最困难的部分是了解规则的作用。 After that it's just a matter of implementing the proper logic. 之后,只需要实现适当的逻辑即可。

Since you wrote the logic of the original rule, you've already won half the battle. 自从您编写了原始规则的逻辑以来,您已经赢得了一半的胜利。 The rest is pure implementation & unfortunately there are no shortcuts. 剩下的只是纯实现,不幸的是没有捷径。 If you have specific API questions, though you can get them answered in the SonarQube Google group 如果您有特定的API问题,尽管可以在SonarQube Google组中得到解答

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM