Skip to content

Fix S1144 FN: Unused local functions #6699

@zsolt-kolbay-sonarsource

Description

Description

S1144 highlights unused private methods, but unused local methods are not accounted for when this check is performed.

Repro steps

public class MyClass
{
        public void MethodUsingLocalMethod()
        {
            void LocalMethod() // FN: local function is never used
            {

            }
        }
}

Expected behavior

An issue should be raised for this local function.

Actual behavior

No issue is raised.

Known workarounds

None.

Related information

  • C#/VB.NET Plugins version: 8.52
  • Visual Studio version: 2022 17.4.4
  • Operating System: Windows 10 Pro (10.0.19045)

Metadata

Metadata

Labels

False NegativeRule is NOT triggered when it should be.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions