Rinatsin/php-project-lvl2

View on GitHub

Showing 6 of 6 total issues

Method buildAstTree has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function buildAstTree($before, $after)
{
    $keys = union(array_keys($before), array_keys($after));
    $ast = array_map(
        function ($key) use ($before, $after) {
Severity: Minor
Found in src/getAst.php - About 1 hr to fix

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

    function renderTreeToPlain($ast, $pathRoot = null)
    {
        $mapped = array_map(
            function ($node) use ($pathRoot) {
                if (isset($pathRoot)) {
    Severity: Minor
    Found in src/formatters/plain.php - About 1 hr to fix

      Avoid too many return statements within this method.
      Confirmed

          return $ast;
      Severity: Major
      Found in src/getAst.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Confirmed

                        return [
                            'name' => $key,
                            'type' => 'changed',
                            'beforeValue' => $before[$key],
                            'afterValue' => $after[$key]
        Severity: Major
        Found in src/getAst.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Confirmed

                              return;
          Severity: Major
          Found in src/formatters/plain.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Confirmed

                return implode("\n", $filteredEmptyNodes);
            Severity: Major
            Found in src/formatters/plain.php - About 30 mins to fix
              Severity
              Category
              Status
              Source
              Language