gpt4 book ai didi

c# - SonarQube C# SuppressMessage,S1871 类别

转载 作者:行者123 更新时间:2023-11-30 23:19:22 31 4
gpt4 key购买 nike

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

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com