IgBuS/php-project-lvl2

View on GitHub

Showing 9 of 9 total issues

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

function iter($diff, $depth = 0)
{
    $mapped = array_map(function ($item) use ($depth) {
        $indent = str_repeat('    ', $depth);
        switch ($item['type']) {
Severity: Minor
Found in src/Formatters/basicFormat.php - About 1 hr to fix

    Avoid too many return statements within this method.
    Open

        return $mapped;
    Severity: Major
    Found in src/Formatters/plainFormat.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return ['key' => $key, 'type' => 'changed', 'oldValue' => $dataBefore[$key], 'newValue' => $dataAfter[$key]];
      Severity: Major
      Found in src/diffBuilder.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

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

          Avoid too many return statements within this method.
          Open

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

            Avoid too many return statements within this method.
            Open

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

              Avoid too many return statements within this method.
              Open

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

                Avoid too many return statements within this method.
                Open

                                return "{$indent}    {$item['key']}: {\n{$result}\n    {$indent}}";
                Severity: Major
                Found in src/Formatters/basicFormat.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                  return [];
                  Severity: Major
                  Found in src/Formatters/plainFormat.php - About 30 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language