Showing 5 of 5 total issues
Method buildDiff
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function buildDiff(object $firstObj, object $secondObj): array
{
$getKeys = fn($obj) => array_keys(get_object_vars($obj));
$keys = array_unique(array_merge($getKeys($firstObj), $getKeys($secondObj)));
Method nodeIterator
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function nodeIterator(array $tree, int $depth): string
{
$indentation = buildIndent($depth);
$formattedData = array_map(function ($node) use ($indentation, $depth): string {
$nodeType = $node['type'];
Avoid too many return
statements within this method. Open
Open
return "{$indentation} + {$nodeName}: {$addedValue}";
Avoid too many return
statements within this method. Open
Open
return "{\n{$joinedData}\n{$indentation}}";
Avoid too many return
statements within this method. Open
Open
return $formattedNode;