mvaload/difference-calculator

View on GitHub

Showing 9 of 9 total issues

Method buildDiff has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function buildDiff($arr1, $arr2)
{
    $keys = array_merge(array_keys($arr1), array_keys($arr2));
    $uniqueKeys = array_values(array_unique($keys));

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

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

    function rendPretty(array $data, $level = 0)
    {
        $spaces = '    ';
        $offset = str_repeat($spaces, $level);
    
    
    Severity: Minor
    Found in src/format/pretty.php - About 1 hr to fix

      Avoid too many return statements within this method.
      Open

          return $diffString;
      Severity: Major
      Found in src/format/plain.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                return !empty($item);
        Severity: Major
        Found in src/format/plain.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                          return '';
          Severity: Major
          Found in src/format/plain.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                    return [
                        'key' => $key,
                        'type' => 'fixed',
                        'valueBefore' => $arr1[$key],
                    ];
            Severity: Major
            Found in src/differ.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                              return "{$offset}{$spaces}{$key}: {$value}";
              Severity: Major
              Found in src/format/pretty.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                    return "{$leftBrace}{$diffString}{$rightBrace}";
                Severity: Major
                Found in src/format/pretty.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

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