Reputation: 878
I'm reading Kent Beck's “TDD by Example” and I can't understand why the cyclomatic complexity of his program is fractional.
In Wikipedia the complexity is defined as M = E − N + 2P
where E, N and P are integers.
Upvotes: 1
Views: 180
Reputation: 37647
I believe that's the average of each method's standalone cyclomatic complexity (M = E - N + 2
). I'm not going to calculate it myself, but
Bank.rate
does have a single if
(page 63)so it seems reasonable that the average is just above 1.
Upvotes: 2