ticktick/php-project-lvl2

View on GitHub
src/Formatters/Pretty.php

Summary

Maintainability
A
2 hrs
Test Coverage

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

    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 "{$indent}{$key}: {\n{$formattedValue}\n{$indent}}";
      Severity: Major
      Found in src/Formatters/Pretty.php - About 30 mins to fix

        There are no issues that match your filters.

        Category
        Status