arkadiy93/php-project-lvl2

View on GitHub

Showing 7 of 7 total issues

Method getAst has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function getAst($firstData, $secondData)
{
    $keys1 = array_keys($firstData);
    $keys2 = array_keys($secondData);
    $allKeys = Collection\union($keys1, $keys2);
Severity: Minor
Found in src/Gendiff.php - About 1 hr to fix

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

    function getRenderMethod($elementType)
    {
        $typeMethods = [
            "nested" => function ($el, $spacesAmount, $renderFunc) {
                ["children" => $children, "key" => $key] = $el;
    Severity: Minor
    Found in src/renders/deepRender.php - About 1 hr to fix

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

      function getRenderMethod($elementType)
      {
          $typeMethods = [
              "nested" => function ($el, $path, $renderFunc) {
                  ["children" => $children, "key" => $key] = $el;
      Severity: Minor
      Found in src/renders/plainRender.php - About 1 hr to fix

        Avoid too many return statements within this method.
        Open

            return $typeMethods[$elementType];
        Severity: Major
        Found in src/renders/plainRender.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return "Property '$propertyPath' was changed. From '$oldPropertyValue' to '$newPropertyValue'";
          Severity: Major
          Found in src/renders/plainRender.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                return $typeMethods[$elementType];
            Severity: Major
            Found in src/renders/deepRender.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return ["$spaces+ $key: $stringNewValue", "$spaces- $key: $stringOldValue"];
              Severity: Major
              Found in src/renders/deepRender.php - About 30 mins to fix
                Severity
                Category
                Status
                Source
                Language