1.2.163. Collect Block Size

Collect block size for instructions such as for, foreach, while, do…while, ifthen.

This is a starting point for reviewing large blocks of code and extract methods.

<?php

foreach($array as $key => $value) {
     // This is a one line block for the foreach
     doSomething();
}

if($a === $b) {
     $a++;
     // This is a two lines block for the ifthen
     doSomething($a, $b);
}

?>

1.2.163.1. Connex PHP features

1.2.163.1.1. Specs

Short name

Dump/CollectBlockSize

Rulesets

All, Changed Behavior, Dump

Exakat since

2.2.0

PHP Version

All

Severity

Minor

Time To Fix

Quick (30 mins)

Precision

Very high

Available in

Entreprise Edition, Exakat Cloud