ElHexio/project-lvl2-s361

View on GitHub

Showing 4 of 4 total issues

Method format has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function format(array $ast, int $level = 0)
{
    $offset = str_pad('', $level * 4, ' ');
    $diff = array_reduce($ast, function ($diff, $node) use ($offset, $level) {
        switch ($node['type']) {
Severity: Minor
Found in src/Formatters/PrettyFormatter.php - About 1 hr to fix

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

    function buildDiffAST(array $before, array $after)
    {
        $allPropertiesNames = array_unique(array_merge(array_keys($before), array_keys($after)));
        $ast = array_reduce($allPropertiesNames, function ($ast, $name) use ($before, $after) {
            $beforeValue = $before[$name] ?? null;
    Severity: Minor
    Found in src/DiffASTBuilder.php - About 1 hr to fix

      Avoid too many return statements within this method.
      Open

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

        Avoid too many return statements within this method.
        Open

                return $ast;
        Severity: Major
        Found in src/DiffASTBuilder.php - About 30 mins to fix
          Severity
          Category
          Status
          Source
          Language