S1854 False Positive due to local functions

PackageReference Include="SonarAnalyzer.CSharp" Version="8.4.0.15306"

Code sample:

        private void Test()
        {
            var entries = GetType();

            ImAmALocalFunction();

            void ImAmALocalFunction()
            {
                if (string.IsNullOrEmpty(entries.ToString()))
                {
                    throw new System.ArgumentException("omy");
                }
            }
        }

I get a squiggly and Warning S1854

1 Like

thanks @gakera - we track it in #3126

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.