Rinatsin/php-project-lvl2

View on GitHub
src/getAst.php

Summary

Maintainability
A
2 hrs
Test Coverage

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

    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

        There are no issues that match your filters.

        Category
        Status