AlexeyShobanov/php-project-lvl2

View on GitHub
src/formatters/Pretty.php

Summary

Maintainability
A
3 hrs
Test Coverage

Method renderAstForPrettyFormat has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function renderAstForPrettyFormat($ast)
{
    $renderAstForPrettyFormat = function ($ast, $depth) use (&$renderAstForPrettyFormat) {
        $textRepresentationOfNodes = array_reduce(
            $ast,
Severity: Minor
Found in src/formatters/Pretty.php - About 1 hr to fix

    Avoid too many return statements within this method.
    Open

            return "{\n{$textRepresentationOfAst}\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 $renderAstForPrettyFormat($ast, 0);
      Severity: Major
      Found in src/formatters/Pretty.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                                return array_merge(
                                    $acc,
                                    [$indent . '+' . $keyValuePairText],
                                    [$indent . '-' . $keyOldValuePairText]
                                );
        Severity: Major
        Found in src/formatters/Pretty.php - About 30 mins to fix

          There are no issues that match your filters.

          Category
          Status