rentery/php-project-lvl2

View on GitHub

Showing 11 of 11 total issues

Method getAst has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function getAst($config1, $config2)
{
    $config1 = get_object_vars($config1);
    $config2 = get_object_vars($config2);

Severity: Minor
Found in src/gendiff.php - About 1 hr to fix

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

    function render($tree)
    {
        $iter = function ($tree, $depth = 1) use (&$iter) {
            $renderedData = array_map(function ($node) use ($iter, $depth) {
                $type = $node['type'];
    Severity: Minor
    Found in src/Formatters/Pretty.php - About 1 hr to fix

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

      function render($tree)
      {
          $iter = function ($tree, $rootKey = '') use (&$iter) {
              $renderedData = array_map(function ($node) use (&$iter, $rootKey) {
                  $type = $node['type'];
      Severity: Minor
      Found in src/Formatters/Plain.php - About 1 hr to fix

        Avoid too many return statements within this method.
        Open

            return "{\n" . $renderedData . "\n}";
        Severity: Major
        Found in src/Formatters/Pretty.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return ['key' => $key,
                              'oldValue' => $config1[$key],
                              'newValue' => $config2[$key],
                              'type' => 'changed'];
          Severity: Major
          Found in src/gendiff.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

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

              Avoid too many return statements within this method.
              Open

                                  return "{$indentSmall}+ {$key}: {$value}";
              Severity: Major
              Found in src/Formatters/Pretty.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                    return $renderedData;
                Severity: Major
                Found in src/Formatters/Plain.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          return $renderedData;
                  Severity: Major
                  Found in src/Formatters/Plain.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                            return is_array($renderedData) ? implode("\n", $renderedData) : $renderedData;
                    Severity: Major
                    Found in src/Formatters/Pretty.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                          return "Property '{$rootKey}{$key}' was added with value: '{$value}'";
                      Severity: Major
                      Found in src/Formatters/Plain.php - About 30 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language