pqr/php-project-lvl2

View on GitHub

Showing 8 of 8 total issues

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

function render(array $diffTree): string
{
    $diffLines = array_map(
        static function ($node) {
            $key = $node['key'];
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(array $diffTree, string $parentPath = ''): string
    {
        $diffLines = array_map(
            static function ($node) use ($parentPath) {
                $key = $node['key'];
    Severity: Minor
    Found in src/Formatters/Plain.php - About 1 hr to fix

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

      function getDiffTree(array $data1, array $data2): array
      {
          $allKeys = array_unique(array_merge(array_keys($data1), array_keys($data2)));
      
          return array_map(
      Severity: Minor
      Found in src/Differ.php - About 1 hr to fix

        Method makeNode has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        function makeNode(string $key, string $diffType, $value1, $value2, ?array $children = null)
        Severity: Minor
        Found in src/Differ.php - About 35 mins to fix

          Avoid too many return statements within this method.
          Open

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

            Avoid too many return statements within this method.
            Open

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

              Avoid too many return statements within this method.
              Open

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

                Avoid too many return statements within this method.
                Open

                                    return addIndent(INDENT_EMPTY, $out);
                Severity: Major
                Found in src/Formatters/Pretty.php - About 30 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language