This rule raises an issue when a private function is never referenced in the code.
A function that is never called is dead code, and should be removed. Cleaning out dead code decreases the size of the maintained codebase, making it easier to understand the program and preventing bugs from being introduced.
This rule detects functions that are never referenced from inside a translation unit, and cannot be referenced from the outside.
public class Foo
{
public static function doSomething(): void // Compliant - public function
{
var foo:Foo = new Foo();
...
}
private function unusedPrivateFunction(): void {...} // Noncompliant
}
public class Foo
{
public static function doSomething(): void // Compliant - public function
{
var foo:Foo = new Foo();
...
}
}