fazvil/php-project-lvl2

View on GitHub

Showing 9 of 9 total issues

Method genDiff has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function genDiff($pathToFile1, $pathToFile2, $format = 'pretty')
{
    $readData1 = readFile($pathToFile1);
    $readData2 = readFile($pathToFile2);

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

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

    function format($ast)
    {
        $currentDepth = 1;
        $buildDiff = function ($ast, $currentDepth) use (&$buildDiff) {
            $iter = array_map(function ($node) use ($buildDiff, $currentDepth) {
    Severity: Minor
    Found in src/Formatters/formatterToPretty.php - About 1 hr to fix

      Avoid too many return statements within this method.
      Open

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

        Avoid too many return statements within this method.
        Open

                            return $buildDiff($node['children'], $pathToKey);
        Severity: Major
        Found in src/Formatters/formatterToPlain.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return formatterToPretty\format($ast);
          Severity: Major
          Found in src/Differ.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

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

              Avoid too many return statements within this method.
              Open

                  return $buildDiff($ast, '');
              Severity: Major
              Found in src/Formatters/formatterToPlain.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

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

                  Avoid too many return statements within this method.
                  Open

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