[英]SonarQube MsBuild, support for C# 7.0 local functions?
I have a problem where SonarQube thinks that my local function ending in an assignment of a variable out of the scope of the function is useless assignment. 我有一个问题,SonarQube认为以函数范围以外的变量赋值结尾的本地函数是无用赋值。 How do I clear this error or bypass it in SonarQube using C# 7.0 definitions?
如何使用C#7.0定义清除此错误或在SonarQube中绕过该错误?
How do I resolve this? 我该如何解决?
Function Definition: 功能定义:
public (bool, int) func(string str)
{
int variable = 0;
// C# 7.0 - Local Functions
void localFunc()
{
variable = 1; //SonarQube complains that this usless assignment needs to be removed
}
return (true, variable);
}
SonarC# doesn't support (yet) C# 7 features and so some analysis results in weird output. SonarC#目前尚不支持C#7功能,因此某些分析结果会产生奇怪的输出。 The only thing you can do for now is to mark the issue as
False Positive
under your SonarQube instance. 您现在唯一能做的就是将SonarQube实例下的问题标记为
False Positive
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.