我们怎样才能忽略Java中的一些SonarQube规则? [英] How can we ignore some SonarQube rules in Java?

查看:753
本文介绍了我们怎样才能忽略Java中的一些SonarQube规则?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们最近开始使用 SonarQube 。我们已经找到了SonarQube建议的一些规则,但我们想忽略它们或给它们低优先级,甚至配置SonarQube建议的时间。例如

We recently started using SonarQube. We have found some rules that are suggested by SonarQube but we want to ignore them or give them a low priority and even configure the time suggested by SonarQube. For e.g

我们希望避免规则(和/或配置SonarQube建议的优先级和时间)

We want to avoid the rule (and/or configure the priority and time suggested by SonarQube) for


  1. 记录此公共课程。和

  2. 完成与此TODO评论相关的任务。

我找不到配置此规则的方法被忽略。我们希望忽略整个项目而不是特定类的这种规则。

I couldn’t find a way to configure this rules to be ignored. We want this kind of rules to be ignored for the whole project not specific classes.

配置此值将有助于我们更好地估算时间以解决重大问题并给出像上述两个规则的低优先级。我们正在使用SonarQube 6

Configuring this values would help us to have a better time estimation to fix major issues and give low priority for the rules like the above two. We are using SonarQube 6

我知道你的建议。

推荐答案

如评论中所述,您所要做的就是从您的个人资料中删除规则或编辑它们以降低其优先级。您需要全局管理质量配置文件权限才能执行此操作。使用该权限登录后,请转到规则界面,搜索要停用的规则,选择规则,单击该规则,然后从相关配置文件中取消激活。

As noted in the comments, all you have to do is remove the rules from your profile or edit them to lower their priority. You need the Global Administer Quality Profiles permission to do that. Once you're logged in with that permission, go to the Rules interface, search for a rule you want to deactivate, select the rule, click on it, and Deactivate it from the relevant profile.

这篇关于我们怎样才能忽略Java中的一些SonarQube规则?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆