navigation

FavourNestedFunctions (FL0091)

Introduced in 0.26.12

Cause

Prefer using local (nested) functions over private module-level functions.

Rationale

With a nested function, one can clearly see from reading the code that there is only one consumer of the function. The code being this way becomes more streamlined. Code is also more concise because nested functions don't need accessibility modifiers.

How To Fix

Move private function inside function that uses it.

Rule Settings

{
    "FavourNestedFunctions": {
        "enabled": false
    }
}