VitaMinKin/php-project-lvl2

View on GitHub

Showing 8 of 8 total issues

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

function convertToPlain(array $diff)
{
    $converter = function ($diff, array $parentNames = []) use (&$converter) {

        $plainStrings = array_map(function ($property) use (&$converter, $parentNames) {
Severity: Minor
Found in src/Formatters/plain.php - About 1 hr to fix

    Method convertToPretty has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function convertToPretty(array $diff)
    {
        $converter = function ($diff, $depth = 0) use (&$converter) {
    
            $prettyStrings = array_map(function ($property) use (&$converter, $depth) {
    Severity: Minor
    Found in src/Formatters/pretty.php - About 1 hr to fix

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

      function createNode($name, $type, $valueBefore, $valueAfter = null, array $children = [])
      Severity: Minor
      Found in src/builder.php - About 35 mins to fix

        Avoid too many return statements within this method.
        Open

                return array_filter($plainStrings, fn($string) => $string !== null);
        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", $converter($diff));
          Severity: Major
          Found in src/Formatters/plain.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                return "{\n" . $converter($diff) . "\n}";
            Severity: Major
            Found in src/Formatters/pretty.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                                  return implode("\n", $strings);
              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", $prettyStrings);
                Severity: Major
                Found in src/Formatters/pretty.php - About 30 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language