Showing 10 of 10 total issues
Method makeAst
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function makeAst($firstProperties, $secondProperties)
{
$allKeys = array_unique(
array_merge(
array_keys($firstProperties),
Method renderPrettyDiff
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function renderPrettyDiff($ast)
{
$iter = function ($ast, $depth = 1) use (&$iter) {
$diffs = array_map(function ($elem) use (&$iter, $depth) {
$name = $elem['name'];
Method renderPlainDiff
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function renderPlainDiff($ast)
{
$iter = function ($ast, $parents = []) use (&$iter) {
$filteredAst = array_filter($ast, fn($elem) => $elem['type'] !== "unchanged");
Avoid too many return
statements within this method. Open
Open
return "$indentStr+ $name: $newValue\n$indentStr- $name: $oldValue";
Avoid too many return
statements within this method. Open
Open
return implode("\n", $diffs);
Avoid too many return
statements within this method. Open
Open
return array_values($ast);
Avoid too many return
statements within this method. Open
Open
return $diff;
Avoid too many return
statements within this method. Open
Open
return $diff;
Avoid too many return
statements within this method. Open
Open
return "{\n" . implode("\n", $diffs) . "\n$shortIndentStr}";
Avoid too many return
statements within this method. Open
Open
return [
'name' => $key,
'type' => 'changed',
'newValue' => $secondProperty,
'oldValue' => $firstProperty