Showing 7 of 7 total issues
Method makeAst
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function makeAst(array $firstData, array $secondData)
{
$union = union(array_keys($firstData), array_keys($secondData));
return array_reduce($union, function ($acc, $key) use ($firstData, $secondData) {
if (array_key_exists($key, $firstData) && array_key_exists($key, $secondData)) {
Method prettyReport
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function prettyReport(array $ast, $level = 0)
{
$prettyTypeMap = [
'nested' => function ($node, $level) {
return getIndents($level) . ' ' . $node['node'] . ': ' . prettyReport($node['children'], $level + 1);
Avoid too many return
statements within this method. Open
Open
return $plainTypeMap[$node['type']]($node);
Avoid too many return
statements within this method. Open
Open
return "{\n{$text}\n{$finalIndents}}";
Avoid too many return
statements within this method. Open
Open
return [];
Avoid too many return
statements within this method. Open
Open
return $str;
Avoid too many return
statements within this method. Open
Open
return [getPreparedPrettyLine($level, '-', $node['node'], $node['from']),
getPreparedPrettyLine($level, '+', $node['node'], $node['to'])];