DEV Community

Discussion on: Clean up your code by removing unneeded indentation ๐Ÿงน

ronnewcomb profile image
Ron Newcomb

As much as I love my extensions that measure the cc of my functions, there's cases where it goes off the rails. A function with only a switch statement, where every case is a single-line return statement, for example. The "parallelism" of the code makes it easy to follow for humans even if by math it's complex.

I also like things like SonarQube / ReSharper / etc for measuring cc and for the "reduce nesting" auto-refactor which fixes the too-much-indentation issue.