fidilly/php-project-lvl2

View on GitHub
src/Renderers/pretty.php

Summary

Maintainability
A
2 hrs
Test Coverage

Method render has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function render($ast, $depth = 0)
{
    $tabs = str_repeat('    ', $depth);
    $composeText = array_reduce($ast, function ($acc, $item) use ($tabs, $depth) {
        $key = $item['key'];
Severity: Minor
Found in src/Renderers/pretty.php - About 1 hr to fix

    Avoid too many return statements within this method.
    Open

                    return $acc;
    Severity: Major
    Found in src/Renderers/pretty.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

          return implode($composeText, "\n") . "\n$tabs}";
      Severity: Major
      Found in src/Renderers/pretty.php - About 30 mins to fix

        There are no issues that match your filters.

        Category
        Status