Hi,
I have just noticed that when calculating the cyclomatic complexity of a method, Moose adds 1 for each boolean operator in the code.
For instance, the cyclomatique complexity of
SomeClass>>aMethod
^true or:false
equals 2
This is funny because I found such a thing anywhere else.
In addition, In the method RBVisitorForFAMIXMetrics>>computeCyclomaticNumber: there is a comment that says :
"The score is basically the number of decision points in a routine + 1. Decision points are taken to be conditionals and loops.”
but then in the code, there is another strange comment :"-- HERE STARTS THE OLD ERRORFUL IMPL --"
and some lines further :
cyclo := self cyclomaticNumber + 1 + booleanOperators.
So my question is : Why booleanOperators is used to calculate cyclomatique complexity. Wouldn’t it be simpler to do cyclo := self cyclomaticNumber + 1?
Thanks in advance