nikitovskij/php-gendiff

View on GitHub

Showing 5 of 7 total issues

Method makePlainOutput has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function makePlainOutput(array $tree): array
{
    $format = function ($tree, $ancestorPath = []) use (&$format) {
        return array_map(function ($node) use (&$format, $ancestorPath) {
            [
Severity: Minor
Found in src/Formatters/Plain.php - About 1 hr to fix

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

    function makePrettyOutput(array $tree, int $depth = 0): string
    {
        $iter = function ($node) use ($depth) {
    
            [
    Severity: Minor
    Found in src/Formatters/Pretty.php - About 1 hr to fix

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

      function makeNode($state, $key, $oldValue = null, $newValue = null, $children = null)
      Severity: Minor
      Found in src/DiffGenerator.php - About 35 mins to fix

        Avoid too many return statements within this method.
        Open

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

          Avoid too many return statements within this method.
          Open

                          return "{$indent}    {$key}: {$formattedValue}";
          Severity: Major
          Found in src/Formatters/Pretty.php - About 30 mins to fix
            Severity
            Category
            Status
            Source
            Language