Renderer/Partial/Debug/DebuggerTrait.php
Showing 10 of 10 total issues
File DebuggerTrait.php
has 300 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php namespace Phug\Renderer\Partial\Debug; use Phug\Formatter;
Function getErrorMessage
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
private function getErrorMessage($error, SourceLocation $location, $data) { /* @var \Throwable $error */ $source = explode("\n", rtrim($data->source)); $errorType = get_class($error);
- Read upRead up
Method getErrorMessage
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getErrorMessage($error, SourceLocation $location, $data) { /* @var \Throwable $error */ $source = explode("\n", rtrim($data->source)); $errorType = get_class($error);
Method initDebugOptions
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function initDebugOptions(Renderer $profilerContainer) { $profilerContainer->setOptionsDefaults([ 'memory_limit' => $profilerContainer->getOption('debug') ? 0x3200000 : -1, // 50MB by default in debug 'execution_max_time' => $profilerContainer->getOption('debug') ? 30000 : -1, // 30s by default in debug
Function handleError
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
public function handleError($error, $code, $path, $source, $parameters, $options) { /* @var \Throwable $error */ $exception = $options['debug'] ? $this->getDebuggedException($error, $code, $source, $path, $parameters, $options)
- Read upRead up
Method getRendererException
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getRendererException($error, $code, $line, $offset, $source, $sourcePath, $parameters, $options) { $colorSupport = $options['color_support']; if (is_null($colorSupport)) { $colorSupport = $this->hasColorSupport();
Method getErrorAsHtml
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getErrorAsHtml($error, $parameters, $data) { $sandBox = new SandBox(function () use ( $error, $parameters,
Method getRendererException
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private function getRendererException($error, $code, $line, $offset, $source, $sourcePath, $parameters, $options)
Method handleError
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function handleError($error, $code, $path, $source, $parameters, $options)
Method getDebuggedException
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private function getDebuggedException($error, $code, $source, $path, $parameters, $options)