Showing 113 of 115 total issues
Method getDebugError
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getDebugError($error, $code, $path = null)
{
/** @var \Throwable $error */
$line = $this->getSourceLine($error);
if ($line === false) {
Method compileNode
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function compileNode(NodeInterface $node, ElementInterface $parent = null)
{
$this->getCompiler()->assert(
$node instanceof ForNode,
'Unexpected '.get_class($node).' given to for compiler.',
Method __construct
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(Lexer $lexer, $input, array $options)
{
$this->lexer = $lexer;
$this->setOptionsRecursive([
'reader_class_name' => Reader::class,
Method getExposedProperties
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getExposedProperties($object, $deep)
{
$result = "\n";
foreach (get_class_methods($object) as $method) {
if (mb_strlen($result) > 0x80000) {
Method renderDirectory
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function renderDirectory($path, $destination = null, $extension = '.html', array $parameters = [])
{
if (is_array($destination)) {
$parameters = $destination;
$destination = null;
Method compileNode
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function compileNode(ParserNodeInterface $node, ElementInterface $parent = null)
{
$compiler = $this->getCompiler();
$compiler->assert(
$node instanceof MixinCallNode,
Method formatKeywordElement
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function formatKeywordElement(KeywordElement $element)
{
$name = $element->getName();
$keyword = $this->getOption(['keywords', $name]);
$result = call_user_func($keyword, $element->getValue(), $element, $name);
Method getDefaultOptions
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getDefaultOptions($options)
{
return [
'debug' => true,
'exit_on_error' => true,
Function mergeEventListeners
has a Cognitive Complexity of 12 (exceeds 7 allowed). Consider refactoring. Open
public function mergeEventListeners($eventListeners)
{
if ($eventListeners instanceof EventManagerInterface) {
$eventListeners = $eventListeners->getEventListeners();
}
- Read upRead up
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 formatMixinCallElement
has a Cognitive Complexity of 12 (exceeds 7 allowed). Consider refactoring. Open
protected function formatMixinCallElement(MixinCallElement $mixinCall)
{
$hasBlock = $mixinCall->hasChildren();
$children = new PhpUnwrap($this->formatElementChildren($mixinCall), $this->formatter);
$mixinName = $mixinCall->getName();
- Read upRead up
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 formatElementChildren
has a Cognitive Complexity of 12 (exceeds 7 allowed). Consider refactoring. Open
protected function formatElementChildren(ElementInterface $element, $indentStep = 1)
{
$indentLevel = $this->formatter->getLevel();
$this->formatter->setLevel($indentLevel + $indentStep);
$content = '';
- Read upRead up
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 compose
has a Cognitive Complexity of 12 (exceeds 7 allowed). Consider refactoring. Open
public function compose($timePrecision, $lineHeight)
{
$duration = microtime(true) - $this->startTime;
$linkedProcesses = new LinkedProcesses($this->events, $this->nodesRegister);
- Read upRead up
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 mergeOptions
has a Cognitive Complexity of 12 (exceeds 7 allowed). Consider refactoring. Open
private static function mergeOptions($options, $values)
{
foreach ($values as $key => &$value) {
if (substr($key, 0, 3) === 'on_') {
if (!is_array($value) || is_callable($value)) {
- Read upRead up
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 scan
has a Cognitive Complexity of 12 (exceeds 7 allowed). Consider refactoring. Open
public function scan(State $state)
{
$tokens = [];
/** @var ImportToken $token */
- Read upRead up
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
Method getIndentLevel
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getIndentLevel(State $state, $maxLevel = INF, callable $getIndentChar = null)
{
if ($maxLevel <= 0) {
return 0;
}
Method enableModules
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function enableModules()
{
/* @var ModuleContainerInterface $this */
$this->addModules($this->getOption('modules'));
Method callAdapter
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function callAdapter($method, $path, $input, callable $getSource, array $parameters)
{
$source = '';
$this->getCompiler()->reset();
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();
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,
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 */