Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/291.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
SonarQube MsBuild,是否支持C#7.0本地函数?_C#_Msbuild_Sonarqube - Fatal编程技术网

SonarQube MsBuild,是否支持C#7.0本地函数?

SonarQube MsBuild,是否支持C#7.0本地函数?,c#,msbuild,sonarqube,C#,Msbuild,Sonarqube,我有一个问题,SonarQube认为我的局部函数以函数范围外的变量赋值结束是无用的赋值。如何使用C#7.0定义在SonarQube中清除或绕过此错误 我如何解决这个问题 功能定义: public (bool, int) func(string str) { int variable = 0; // C# 7.0 - Local Functions void localFunc() { v

我有一个问题,SonarQube认为我的局部函数以函数范围外的变量赋值结束是无用的赋值。如何使用C#7.0定义在SonarQube中清除或绕过此错误

我如何解决这个问题

功能定义:

    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#目前还不支持C#7功能,因此一些分析会导致奇怪的输出。现在唯一可以做的就是在SonarQube实例下将问题标记为
假阳性