我们如何忽略 Java 中的一些 SonarQube 规则? [英] How can we ignore some SonarQube rules in Java?

查看:47
本文介绍了我们如何忽略 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天全站免登陆