Check the NPath calculation
See http://codingswag.ghost.io/cyclomatic-and-npath-complexity-explained/.
We should add some test cases for this calculation.
NPath is now included already. I'm not sure if it's 100% correct, but it's in. See #28 and #29
I believe that NPath actually needs to consider ternary statements too, so this will need adding.
I still have a doubt about this one, I think we need to multiply the _npathComplexity for each statement of the function (that's the difference with the cyclomatic). We should find some reference or some result to compare on a given test case.
Ok, I've re-opened for now then.
See https://modess.io/npath-complexity-cyclomatic-complexity-explained/
What we should do :
- Consider the number of paths inside a context (use the statementStack)
- Start at 1 as the default value for the number of paths
- Add 1 when we encounter an ELSE, ELSEIF, CASE (after the first), ...
- When going down a nesting level (closing a IF statement for exemple), multiply the number of paths of the current context by the number of paths we just closed.