- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 System.Diagnostics.CodeAnalysis.SuppressMessage
属性来阻止 sonarqube 在我们代码库中的特定方法上引发此问题。我不确定 suppress message 属性应该采用什么形式。我在以下方面尝试了一些变体,但没有成功。
[SuppressMessage("csharpsquid", "S1871:Two branches in the same conditional structure should not have exactly the same implementation")]
public static string SomeMethod(string input)
这是问题文档的链接:http://dist.sonarsource.com/plugins/csharp/rulesdoc/0.9.0-RC/S1871.html
使用:sonar-csharp-plugin-5.3.2
最佳答案
SonarQube C# 插件版本 5.4.0.464 修复了这个问题。看看这张票:https://jira.sonarsource.com/browse/SONARCS-613
关于c# - SonarQube C# SuppressMessage,S1871 类别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40338610/
我在测试方法中使用下划线以提高可读性,并且我想抑制整个测试命名空间的 FxCop 错误/警告。 我怎样才能做到这一点?我玩过 GlobalSuppressions.cs 但没有任何效果: [modul
我已经尝试过使用suppressMessages(expr)、suppressWarnings(expr)、 但他们一直在输出消息。 例如: suppressWarnings(ksvm(y~., da
我正在尝试创建一个单元测试,它只会对不抑制相应消息的类型失败。但是,我无法在单元测试中访问任何类型的 SuppressMessage 属性。是否可以在运行时访问 SuppressMessage 属性?
我想实现 CodeContracts 的以下建议: CodeContracts: MyModule: Method MyModule.MyClass.MyMethod: To mask *all* w
我想知道人们(即公司/开发人员)是否真的关心在装运组件中放置 [SuppressMessage] 属性。 在项目文件中创建单独的配置,在 Release模式下包含 CODE_ANALYSIS,然后在最
我在某些应用程序中有这种代码(来自微软) [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Naming
我正在尝试使用 System.Diagnostics.CodeAnalysis.SuppressMessage 属性来阻止 sonarqube 在我们代码库中的特定方法上引发此问题。我不确定 supp
我想将抑制 StyleCop 警告所需的字符串作为常量放置在一个类中,这样我就不需要到处放置字符串并受益于查找所有引用函数来找出我抑制了多少次哪个规则。 public class Rules {
我想将抑制 ReSharper 警告所需的字符串作为常量放置在一个类中,这样我就不需要到处放置字符串并受益于查找所有引用函数来找出我抑制了多少次哪个规则。 public class Rules {
我在命名空间中收集了我的枚举。因此,我有一个 *.cs 文件,其中包含枚举,没有类。 Stylecop 提示,我想压制它,但只是为了这个文件/命名空间。不是全局性的,所以我不想关闭规则。 [mo
我有这样一个类: [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:Identifier
SupressMessage 选项在 VS 2010 Pro 中不可用吗? 当我右键单击警告列表中的警告时,没有可以抑制的选项。我也试过有错误,没有选择。然后我尝试创建自己的 GlobalSuppre
我在 Visual Studio 2017 中抑制了几条 (IntelliSense) 消息。我在文件 GlobalSuppressions.cs 中创建了条目喜欢: [assembly: Syste
我是一名优秀的程序员,十分优秀!