In Sonar, how to prevent checking some rules in some packages?(在 Sonar 中,如何防止检查某些包中的某些规则?)
问题描述
我们有一个带有公共部分的 Android/Blackberry 项目.显然,这部分是为编译到 Android 和 Blackberry 目标而编写的,因此不能使用一些较新的 Java 功能(例如,Integer.valueOf).我想跳过一些专门针对该部分的规则.有没有办法做到这一点?
如果您将公共部分分离到自己的项目中,您可以添加新的 Sonar 中的质量配置文件(您在其中停用了这些规则)并将其分配给您的公共项目.
除此之外,您还可以使用
//NOSONAR
在一行中取消警告(请参阅常见问题解答).p>
We have an Android/Blackberry project with a common part. That part, obviously, is written to compile to both Android and Blackberry targets, and, consequently, cannot use some of the newer Java features (e.g., Integer.valueOf). I'd like to skip some of the rules specifically for that part. Is there a way to do this?
If you separate the common part to an own project you can add a new Quality Profile in Sonar (where you deactivated these rules) and assign it to your common project.
Apart from that you can use the
// NOSONAR
comment to supress a warning on a single line (see FAQ).
这篇关于在 Sonar 中,如何防止检查某些包中的某些规则?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 Sonar 中,如何防止检查某些包中的某些规则?
基础教程推荐
- 设置 bean 时出现 Nullpointerexception 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- 降序排序:Java Map 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01