yulia633/php-project-lvl2

View on GitHub

Showing 6 of 7 total issues

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

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

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

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

      Avoid too many return statements within this method.
      Open

              return makeNode($key, 'updated', $firstData->$key, $secondData->$key);
      Severity: Major
      Found in src/Differ.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

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

          Avoid too many return statements within this method.
          Open

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

            Avoid too many return statements within this method.
            Open

                return "{\n{$preparedValue}\n{$indent}}";
            Severity: Major
            Found in src/Formatters/Stylish.php - About 30 mins to fix
              Severity
              Category
              Status
              Source
              Language