JuliaStrelkova/project-lvl2-s427

View on GitHub

Showing 5 of 5 total issues

Method render has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function render(array $data, int $level = 0): string
    {
        $indentation = $this->renderIndentation($level);

        $result = array_reduce(
Severity: Minor
Found in src/Renderer/RendererPretty.php - About 1 hr to fix

    Method render has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function render(array $data, array $keyChain = []): string
        {
            $rows = array_reduce(
                $data,
                function (array $acc, array $item) use ($keyChain) {
    Severity: Minor
    Found in src/Renderer/RendererPlain.php - About 1 hr to fix

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

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

        Avoid too many return statements within this method.
        Open

                                return implode(
                                    '',
                                    [$acc, $indentation, '  + ', $item['key'], ': ', $newRenderedValue, PHP_EOL]
                                );
        Severity: Major
        Found in src/Renderer/RendererPretty.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return implode('', ['{', PHP_EOL, $result, $indentation, '}',]);
          Severity: Major
          Found in src/Renderer/RendererPretty.php - About 30 mins to fix
            Severity
            Category
            Status
            Source
            Language