← Back to context

Comment by ozim

14 hours ago

Weird question to ask, that is pretty obvious.

Worst things happen always when 2 or more systems are combined because each system might be simple on its own, yet a combination is always much more complex.

> Weird question to ask, that is pretty obvious.

For something the the prior statement it is never a weird question to ask of there actually evidence of this or just it seems like it should be true so we believe it.

There are tons of things that seem like they would obviously be true, but it turns out they aren't.

  • System is more complex based on possible states it can have or inputs/outputs.

    That is just maths here working. Two systems combined always will have more states and inputs/outputs.

    There is nothing to check here as it can be proven purely by maths.

    Complex systems having more attack surface are obviously less secure.

    They might be less interesting for attackers if they have to scan huge attack surface like IPv6 vs IPv4 but no one is claiming IPv6 network is more secure.

    •   > That is just maths here working
      

      No this is just numerology here, it's meaningless.

    • No. Watch the simple made easy talk.

      Just more I/O isn’t more complicated nor a bigger risk. More entanglement is more complicated.

It’s not obvious to me because cyclomatic complexity is not a straightforward proxy for the number of systems that are being combined.

It’s also the case that some of the most common sources of vulnerabilities, such as SQL injection, introduce no additional cyclomatic complexity. Heck, buffer overflows are good for your cyclomatic complexity - those array bounds checks are all extra branches.

  • Buffer overflow checks are really only going to be a linear growth in CC. It's when things move towards exponential growth or higher that it gets really easy to introduce flaws of many kinds.

    Now, it's probably not a direct correlation. I'd think security bugs are more likely from programmers that unintentionally raise CC without really realizing it. Aka, overreaching their own knowledge when simpler structures are avaliable.

    • Sure. It’s just that there’s also so much research that has found that cyclomatic complexity is theoretically ill-founded, and that it tends to underperform other ways of measuring complexity. Most notably, just counting lines of code. (Not per function, in total.)

      Here’s an oldie but goodie: https://cs.du.edu/~snarayan/sada/teaching/COMP3705/lecture/p...

      I’ve personally had better success thinking of it as more of a measure of readability than of quality.

I'd argue that assuming something is obvious without any empirical validation is the root of a huge number of misconceptions that humanity has historically had. There's a reason science suddenly started moving a lot faster after we moved past Aristotle and started measuring things in experiments.