I'm writing a paper on introductory programming for young learners. To determine the difficulty level of a program, I'd like to draw on the concept of cyclomatic complexity, which I've come across during my research. I'd really appreciate if you could check my figures, as I'm not at all sure about whether I'm doing the maths correctly.
Here is my Scratch program, and the control flow graphs that I derived from it.
The program consists of small concurrent units of code and events. According to the cyclomatic complexity formula M = E − N + 2P
, I came up with a complexity of 22
.
- Total number of Edges: 50
- Total number of Nodes: 56
- Number of connected components: 14
Do you agree with my solution?