Cabyca/php-project-lvl2

View on GitHub

Showing 9 of 9 total issues

Method stylish has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function stylish(array $astTree, int $depth = 0)
{
    $indent = buildIndent($depth, 4);

    $result = array_map(function ($node) use ($depth, $indent) {
Severity: Minor
Found in src/Formatters/Stylish.php - About 1 hr to fix

    Avoid too many return statements within this method.
    Open

        return (string) $value;
    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, 'type' => 'unchanged', 'value' => $data1->$key];
      Severity: Major
      Found in src/BuildAstTree.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

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

          Avoid too many return statements within this method.
          Open

              return '{' . PHP_EOL . implode("", $result) . $indent . '}';
          Severity: Major
          Found in src/Formatters/Stylish.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

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

              Avoid too many return statements within this method.
              Open

                              return $indent . "    " . $node['key'] . ": " . $valueUnchanged . PHP_EOL;
              Severity: Major
              Found in src/Formatters/Stylish.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                    return '{' . PHP_EOL . implode("", $stringOfArray) . $indent . '}';
                Severity: Major
                Found in src/Formatters/Stylish.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

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