This metric may not apply to the whole function,
but the maximum 'nestedness' (nesting for-loops, if-statements, etc.)
may be an interesting metric to detect code smell.
It closely relates to indentation.
Got this from the Linux kernel coding style:
The answer to that is that if you need
more than 3 levels of indentation, you're screwed anyway, and should fix
your program.
This metric may not apply to the whole function, but the maximum 'nestedness' (nesting for-loops, if-statements, etc.) may be an interesting metric to detect code smell.
It closely relates to indentation. Got this from the Linux kernel coding style: