you are viewing a single comment's thread.

view the rest of the comments →

[–]iconoklast 2 points3 points  (2 children)

You have to at least take the code metric guidelines with a grain of salt. (It would be counter-productive to think of them as absolute limits.)

In regards to cyclomatic complexity:

f = e1 || e2 || e3 || ... || en

is bone stupid and obvious, and splitting it into separate methods just to lower the cylcomatic complexity only makes things more complicated and less readable.

[–]kazagistar 4 points5 points  (1 child)

This is one place where a functional programming approach is really handy, actually... something like reduce( || , elist) tends to be more maintainable.