SonarQube C# SuppressMessage,S1871 类别

SonarQube C# SuppressMessage, Category for S1871

我正在尝试使用 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)

这是该问题的文档 link: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