lobr17/php-project-lvl2

View on GitHub

Showing 8 of 8 total issues

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

function iter($tree, $depth)
{
    $tab = createTab($depth * 4 - 2);
    $closeTab = createTab($depth * 4 - 4);
    $childDepth = $depth + 1;
Severity: Minor
Found in src/Formatters/PrettyFormat.php - About 1 hr to fix

    Avoid too many return statements within this method.
    Open

        return $result;
    Severity: Major
    Found in src/TreeBuilder.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

        Avoid too many return statements within this method.
        Open

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

          Avoid too many return statements within this method.
          Open

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

            Avoid too many return statements within this method.
            Open

                            return "${tab}  {$node['name']}: " . iter($node['children'], $childDepth);
            Severity: Major
            Found in src/Formatters/PrettyFormat.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                  return "{\n" . implode("\n", $result) . "\n${closeTab}}";
              Severity: Major
              Found in src/Formatters/PrettyFormat.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            return ['name' => $key, 'type' => 'changed', 'oldValue' => $data1[$key], 'newValue' => $data2[$key]];
                Severity: Major
                Found in src/TreeBuilder.php - About 30 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language