zmshurik/project-lvl2-s173

View on GitHub

Showing 3 of 3 total issues

Method getDiffAst has 69 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function getDiffAst($data1, $data2)
{
    $typeMap = [
        'need check in deep' => [
            'getItem' => function ($key) use ($data1, $data2) {
Severity: Major
Found in src/gendiff.php - About 2 hrs to fix

    Method renderToPretty has 51 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function renderToPretty($ast, $isFirstCall = true)
    {
        $processChildren = function ($children, $name, $sign) {
            $value = renderToPretty($children, NOT_FIRST_CALL);
            $result = "$sign $name: " . implode(PHP_EOL, $value);
    Severity: Major
    Found in src/Renderers/toPretty.php - About 2 hrs to fix

      Method renderToPlain has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function renderToPlain($ast, $parents = '')
      {
          $neededNodes = array_filter($ast, function ($node) {
              return $node['type'] != 'not changed';
          });
      Severity: Minor
      Found in src/Renderers/toPlain.php - About 1 hr to fix
        Severity
        Category
        Status
        Source
        Language