属性を使用してSystem.Diagnostics.CodeAnalysis.SuppressMessage
、コードベースの特定のメソッドで sonarqube がこの問題を引き起こすのを止めようとしています。抑制メッセージ属性がどのような形式をとるべきか正確にはわかりません。次のいくつかのバリエーションを試してみましたが、うまくいきませんでした。
[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