vitek-mo/php-project-lvl2

View on GitHub

Showing 6 of 6 total issues

Method renderPretty has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function renderPretty(array $array, $indent = "")
{
    $openingBrace = $indent === "" ? "{\n" : "";
    
    $result = array_reduce($array, function ($acc, $node) use ($indent) {
Severity: Minor
Found in src/Formatters/Pretty.php - About 1 hr to fix

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

    function renderPlain($diff, $path = '')
    {
        $result = array_map(function ($node) use ($path) {
            $type = getNodeType($node);
            $key = getKey($node);
    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($type, $key, $oldValue, $newValue, $children)
      Severity: Minor
      Found in src/Analyzer.php - About 35 mins to fix

        Avoid too many return statements within this method.
        Open

            return $path === '' ? $flattenedResult . "\n" : $flattenedResult;
        Severity: Major
        Found in src/Formatters/Plain.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                          return;
          Severity: Major
          Found in src/Formatters/Plain.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

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