Code inspection: Add explicit 'return' or 'continue' before local functions
When you have one or more local functions defined at the end of a method, ReSharper suggests adding an explicit return
between the last executable statement and the local function definition. The method will return at that point anyway, but making this explicit will enhance the clarity of the method's control flow for readers. This is particularly beneficial if the local function definition is lengthy, or if there are multiple local functions. In these instances, the reader will not have to scroll to the end of the method to check for more executable statements after the local function definitions.
Here is an example:
The same applies when a local function is defined inside a block. In such cases, adding an explicit continue
statement makes the structure of the block more comprehensible: