protected function nesting($first, $second, $third, $fourth) { if ($first) { if ($second) { if ($third) { if ($fourth) { doSomethink(); } } } } }
protected function multilineCondition($first, $second, $third) { if ($first > 7 && $second < 9 || $third) { doSomethink(); } }
protected function cyclomaticComplexity($first) { switch ($first) { case 1: doSomethink(); break; default: doSomethink(); } if ($first) { doSomethink(); } else { if ($first) { doSomethink(); } } while ($first) { for (; $first; $first) { doSomethink(); } } do { for (; true; $first) { doSomethink(); } } while ($first); if ($first) { do { doSomethink(); } while ($first); } }
class Bad { private $a = doSomethink($spacedParenthesis); }