DmitriySmolin/php-project-48

View on GitHub
src/Formatters/Stylish.php

Summary

Maintainability
A
2 hrs
Test Coverage
A
93%

Method nodeIterator has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function nodeIterator(array $tree, int $depth): string
{
    $indentation = buildIndent($depth);
    $formattedData = array_map(function ($node) use ($indentation, $depth): string {
        $nodeType = $node['type'];
Severity: Minor
Found in src/Formatters/Stylish.php - About 1 hr to fix

    Avoid too many return statements within this method.
    Open

                    return "{$indentation}  + {$nodeName}: {$addedValue}";
    Severity: Major
    Found in src/Formatters/Stylish.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

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

        Avoid too many return statements within this method.
        Open

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

          There are no issues that match your filters.

          Category
          Status