1.2.569. Indentation Levels

Collect all level of indentations for methods and functions. Inside methods, indentation level raises for structures such as switch, match(), closures, ifthen, and loops. It is recommended to avoid going too high in the levels, as the code becomes less readable.

<?php

function foo() {
    $a = 1; // level 1
    if ($b == 2) {
        $c = 1; // level 2
    }
    $d = 4; // level 1
}

?>

1.2.569.1. Specs

Short name

Dump/IndentationLevels

Rulesets

All, CE, Changed Behavior, Dump

Exakat since

1.9.3

PHP Version

All

Severity

Minor

Time To Fix

Quick (30 mins)

Precision

Very high

Features

indentation, inclusion

Available in

Entreprise Edition, Community Edition, Exakat Cloud