M1kolkus/php-project-lvl2

View on GitHub

Showing 5 of 5 total issues

Method buildDiff has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function buildDiff(array $arr1, array $arr2): array
{
    $keys = array_merge(array_keys($arr1), array_keys($arr2));
    $newKeys = array_unique($keys);
    $sortedKeys = sort($newKeys, fn($key1, $key2) => $key1 <=> $key2);
Severity: Minor
Found in src/Differ.php - About 1 hr to fix

    Method createNode has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        string $key,
        string $type,
        string $operation,
        mixed $value,
        mixed $oldType = null,
    Severity: Minor
    Found in src/Tree.php - About 45 mins to fix

      Avoid too many return statements within this method.
      Open

          return $iter($value);
      Severity: Major
      Found in src/Formatters/Stylish.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                return null;
        Severity: Major
        Found in src/Formatters/Plain.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

              return implode("\n", array_filter($lines));
          Severity: Major
          Found in src/Formatters/Plain.php - About 30 mins to fix
            Severity
            Category
            Status
            Source
            Language