Showing 6 of 6 total issues
Method makeDiff
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function makeDiff($data1, $data2)
{
$arrUniqKeys = array_unique(array_merge(array_keys($data1), array_keys($data2)));
$result = array_reduce($arrUniqKeys, function ($acc, $key) use ($data1, $data2) {
if (array_key_exists($key, $data1) && array_key_exists($key, $data2)) {
Method renderPretty
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function renderPretty($data, $depth = 0)
{
$result = array_map(function ($node) use ($depth) {
['typeInfo' => $typeInfo,
Method buildMessages
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function buildMessages($data, $parents = []):array
{
$plain = array_reduce($data, function ($acc, $node) use ($parents) {
$parents[] = $node['nameKey'];
$parentsPath = implode('.', $parents);
Method buildDataStructure
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function buildDataStructure($typeInfo, $nameKey, $oldValue, $newValue, $children = null)
Avoid too many return
statements within this method. Open
Open
return makeString($depth, 'specialEmpty', $nameKey, renderPretty($children, $depth + 1));
Avoid too many return
statements within this method. Open
Open
return '{' . PHP_EOL . $outStr . addSpace($depth) . '}';