21

We did a small automated review on our code base at work. We discovered that multiple single functions written by my colleagues have a cyclomatic complexity of over 420.

I can't think of words to describe how shit that is.

Comments
  • 3
    @irene multiple 1000 line single functions
  • 0
    What the actual fuck
  • 7
    I thought this was a 420 joke. Then I looked up cyclomatic complexity.

    Good god
  • 0
    Actually one is 500
  • 0
    It's over 400!!!

    Now seriously, that's messed up :/
  • 1
    Damn bro that code blazing it for real 😂
  • 2
    This would be a valuable learning experience for everyone in the team. I can though, only imagine how the code written by 2 of the developers that worked where I am at before would score........brb i am gonna need a bigger drink
  • 1
    @endor So it's a bit... high?
  • 0
    Wow, worst I had seen was 'bout 160. That was a function nobody dared to touch.
  • 0
    Holy crap! Wikipedia says that optimal complexity is 10...15.
    But 420!.. 😬😰😱
  • 0
    I believe one of the functions at my previous job was 360?

    But features there were often broken up into a rats nest of interdependent functions, each having shared state and globals and the works. So technically their individual complexities were low, but good fucking luck following any of it.

    Anyway, I should run my current codebase through this. I'm really curious.
Add Comment