Open
Description
I apologize if this isn't the correct repo to report this
CodeClimate reports the Cognitive Complexity of the following function as 14
I believe the value should be 12
It seems that CodeClimate is incorrectly incrementing the continue
statements
function testFunction($array)
{
if (false) {
return;
}
$file = '';
$line = 0;
if (false) {
throw new \RuntimeException('false was true! ');
}
foreach ($array as $key => $val) {
if (\is_int($key)) {
continue;
}
if (\is_string($val)) {
continue;
}
if (\is_array($val)) {
foreach ($val as $val2) {
// empty
}
}
}
}
continue;
should not increment
continue LABEL;
should increment
Metadata
Metadata
Assignees
Labels
No labels