I'm not sure if this issue is really a "issue", or if it's just my misconception of cyclomatic complexity, but:
- if the
if + else if tokens are sufficient to get full branch coverage (i.e.: else worth 0), shouldn't the same logic be applied to the default case of switch statements, instead of valuing it as 1?
- if I have a block of code that looks like this:
try
{
// something
}
catch (\PDOException $e)
{
// foo
}
catch (\Exception $e)
{
// bar
}
Shouldn't try be worth 0 and each catch block be worth 1?
I'm not sure if this issue is really a "issue", or if it's just my misconception of cyclomatic complexity, but:
if+else iftokens are sufficient to get full branch coverage (i.e.:elseworth 0), shouldn't the same logic be applied to thedefaultcase ofswitchstatements, instead of valuing it as 1?Shouldn't
trybe worth 0 and eachcatchblock be worth 1?finally(http://php.net/manual/en/language.exceptions.php) block should be counted, but should it?gotokeywords or it's labels?