What is Cyclomatic Complexity?

后端 未结 15 1314

A term that I see every now and then is \"Cyclomatic Complexity\". Here on SO I saw some Questions about \"how to calculate the CC of Language X\" or \"How do I do Y with th

15条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-07 20:16

    That's sort of it. However, each branch of a "case" or "switch" statement tends to count as 1. In effect, this means CC hates case statements, and any code that requires them (command processors, state machines, etc).

提交回复
热议问题