ticktick/php-project-lvl2

View on GitHub

Showing 8 of 8 total issues

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

function formatLines(array $tree, int $depth = 1): array
{
    $formatNode = function ($node) use ($depth) {
        $type = $node['type'];
        $key = $node['name'];
Severity: Minor
Found in src/Formatters/Pretty.php - About 1 hr to fix

    Method makeNode has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function makeNode(string $name, string $type, $oldValue = null, $newValue = null, array $children = [])
    Severity: Minor
    Found in src/Differ.php - About 35 mins to fix

      Avoid too many return statements within this method.
      Open

          return array_map($formatNode, $tree);
      Severity: Major
      Found in src/Formatters/Pretty.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

            return array_map($formatNode, $tree);
        Severity: Major
        Found in src/Formatters/Plain.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

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

            Avoid too many return statements within this method.
            Open

                    return makeNode($key, TYPE_CHANGED, $structure1->$key, $structure2->$key);
            Severity: Major
            Found in src/Differ.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

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

                Avoid too many return statements within this method.
                Open

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