DmitriySmolin/php-project-48

View on GitHub

Showing 5 of 5 total issues

Method buildDiff has 39 lines of code (exceeds 25 allowed). Consider refactoring.
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)));
Severity: Minor
Found in src/Differ.php - About 1 hr to fix

    Method nodeIterator has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function nodeIterator(array $tree, int $depth): string
    {
        $indentation = buildIndent($depth);
        $formattedData = array_map(function ($node) use ($indentation, $depth): string {
            $nodeType = $node['type'];
    Severity: Minor
    Found in src/Formatters/Stylish.php - About 1 hr to fix

      Avoid too many return statements within this method.
      Open

                      return "{$indentation}  + {$nodeName}: {$addedValue}";
      Severity: Major
      Found in src/Formatters/Stylish.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

            return "{\n{$joinedData}\n{$indentation}}";
        Severity: Major
        Found in src/Formatters/Stylish.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return $formattedNode;
          Severity: Major
          Found in src/Formatters/Stylish.php - About 30 mins to fix
            Severity
            Category
            Status
            Source
            Language