phug-php/renderer

View on GitHub

Showing 34 of 34 total issues

Method getRendererException has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function getRendererException($error, $code, $line, $offset, $source, $sourcePath, $parameters, $options)
    {
        $colorSupport = $options['color_support'];
        if (is_null($colorSupport)) {
            $colorSupport = $this->hasColorSupport();
Severity: Minor
Found in Renderer/Partial/Debug/DebuggerTrait.php - About 1 hr to fix

    Method getErrorAsHtml has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function getErrorAsHtml($error, $parameters, $data)
        {
            $sandBox = new SandBox(function () use (
                $error,
                $parameters,
    Severity: Minor
    Found in Renderer/Partial/Debug/DebuggerTrait.php - About 1 hr to fix

      Method getProcesses has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function getProcesses($list, $link, $index, $duration, $maxSpace, $lineHeight, $timePrecision)
          {
              $count = count($list);
              for ($i = $count > 1 ? 1 : 0; $i < $count; $i++) {
                  /** @var Event $previousEvent */
      Severity: Minor
      Found in Renderer/Profiler/Profile.php - About 1 hr to fix

        Method getRendererException has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            private function getRendererException($error, $code, $line, $offset, $source, $sourcePath, $parameters, $options)
        Severity: Major
        Found in Renderer/Partial/Debug/DebuggerTrait.php - About 1 hr to fix

          Method getProcesses has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              private function getProcesses($list, $link, $index, $duration, $maxSpace, $lineHeight, $timePrecision)
          Severity: Major
          Found in Renderer/Profiler/Profile.php - About 50 mins to fix

            Method getDebuggedException has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                private function getDebuggedException($error, $code, $source, $path, $parameters, $options)
            Severity: Minor
            Found in Renderer/Partial/Debug/DebuggerTrait.php - About 45 mins to fix

              Method getSandboxCall has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  private function getSandboxCall(&$source, $method, $path, $input, callable $getSource, array $parameters)
              Severity: Minor
              Found in Renderer/Partial/AdapterTrait.php - About 45 mins to fix

                Method handleError has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public function handleError($error, $code, $path, $source, $parameters, $options)
                Severity: Minor
                Found in Renderer/Partial/Debug/DebuggerTrait.php - About 45 mins to fix

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

                          EventList $events,
                          SplObjectStorage $nodesRegister,
                          $startTime,
                          $initialMemoryUsage,
                          $eventDump
                  Severity: Minor
                  Found in Renderer/Profiler/Profile.php - About 35 mins to fix

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

                        public function displayCached($path, $input, callable $rendered, array $variables, &$success = null);
                    Severity: Minor
                    Found in Renderer/CacheInterface.php - About 35 mins to fix

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

                          public function displayCached($path, $input, callable $rendered, array $variables, &$success = null)
                      Severity: Minor
                      Found in Renderer/Adapter/FileAdapter.php - About 35 mins to fix

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

                            public function callAdapter($method, $path, $input, callable $getSource, array $parameters)
                        Severity: Minor
                        Found in Renderer/Partial/AdapterTrait.php - About 35 mins to fix

                          Function renderDirectory has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function renderDirectory($path, $destination = null, $extension = '.html', array $parameters = [])
                              {
                                  if (is_array($destination)) {
                                      $parameters = $destination;
                                      $destination = null;
                          Severity: Minor
                          Found in Renderer.php - About 35 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Function record has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              private function record(Event $event)
                              {
                                  $time = microtime(true) - $this->startTime;
                                  $container = $this->getContainer();
                                  $maxTime = $container->getOption('execution_max_time');
                          Severity: Minor
                          Found in Renderer/Profiler/ProfilerModule.php - About 25 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Severity
                          Category
                          Status
                          Source
                          Language