KulikovRV/php-project-lvl2

View on GitHub

Showing 9 of 9 total issues

Method iter has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function iter(array $node, int $depth = 1): string
{
    $children = pick($node, 'value');

    $space = buildIndent($depth);
Severity: Minor
Found in src/formatters/Stylish.php - About 1 hr to fix

    Method iter has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function iter(array $array1, array $array2): array
    {
        $array1Keys = array_keys($array1);
        $array2Keys = array_keys($array2);
        $uniqueKeys = array_unique(array_merge($array1Keys, $array2Keys));
    Severity: Minor
    Found in src/Differ.php - About 1 hr to fix

      Method iter has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function iter(array $node, string $ansentry = '')
      {
          $children = pick($node, 'value');
      
          $oldValue = pick($node, 'old value');
      Severity: Minor
      Found in src/formatters/Plain.php - About 1 hr to fix

        Avoid too many return statements within this method.
        Open

            return $result;
        Severity: Major
        Found in src/formatters/Stylish.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return implode("\n", $lines);
          Severity: Major
          Found in src/formatters/Stylish.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                return $result;
            Severity: Major
            Found in src/Differ.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return "Property '$ansentry{$node['key']}' was updated. From {$formattedValue2} to {$formattedValue3}";
              Severity: Major
              Found in src/formatters/Plain.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                        return [
                            'key' => $key,
                            'status' => 'saved',
                            'value' => $value1
                        ];
                Severity: Major
                Found in src/Differ.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                              return "$space+ {$node['key']}: $formattedValue";
                  Severity: Major
                  Found in src/formatters/Stylish.php - About 30 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language