Showing 113 of 115 total issues
Function yieldAssignmentElement
has a Cognitive Complexity of 11 (exceeds 7 allowed). Consider refactoring. Open
protected function yieldAssignmentElement(AssignmentElement $element)
{
foreach ($this->getOption('assignment_handlers') as $handler) {
$iterator = $handler($element) ?: [];
- 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 handleError
has a Cognitive Complexity of 11 (exceeds 7 allowed). Consider refactoring. 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
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 isBlockTag
has a Cognitive Complexity of 11 (exceeds 7 allowed). Consider refactoring. Open
protected function isBlockTag(MarkupInterface $element)
{
if ($element->belongsTo($this->getOption('inline_tags'))) {
return false;
}
- 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 __construct
has a Cognitive Complexity of 10 (exceeds 7 allowed). Consider refactoring. Open
public function __construct(EventList $events, SplObjectStorage $nodesRegister)
{
$this->nodesRegister = $nodesRegister;
if ($events) {
- 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 calculateIndex
has a Cognitive Complexity of 10 (exceeds 7 allowed). Consider refactoring. Open
private function calculateIndex($lines, $min, $max)
{
$index = 0;
foreach ($lines as $level => $line) {
foreach ($line as $process) {
- 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 scanInterpolationTokens
has a Cognitive Complexity of 10 (exceeds 7 allowed). Consider refactoring. Open
private function scanInterpolationTokens(State $state, &$firstToken)
{
if (static::INTERPOLATION_ENABLED) {
foreach ($state->scan(InterpolationScanner::class) as $subToken) {
if ($firstToken) {
- 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 10 (exceeds 7 allowed). Consider refactoring. Open
public function scan(State $state)
{
$keywords = $state->getOption('keyword_names');
if (count($keywords)) {
- 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 getRendererException
has 8 arguments (exceeds 6 allowed). Consider refactoring. Open
private function getRendererException($error, $code, $line, $offset, $source, $sourcePath, $parameters, $options)
Function readString
has a Cognitive Complexity of 10 (exceeds 7 allowed). Consider refactoring. Open
public function readString(array $escapeSequences = null, $raw = false)
{
if (!$this->peekQuote()) {
return;
}
- 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 isInFunctionParams
has a Cognitive Complexity of 10 (exceeds 7 allowed). Consider refactoring. Open
private function isInFunctionParams(&$tokens, $index)
{
$afterOpen = false;
for ($i = $index - 1; $i >= 0; $i--) {
if (in_array($tokens[$i], [')', '}'], true)) {
- 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 compileNode
has a Cognitive Complexity of 10 (exceeds 7 allowed). Consider refactoring. Open
public function compileNode(NodeInterface $node, ElementInterface $parent = null)
{
$nodeEvent = new NodeEvent($node);
$this->trigger($nodeEvent);
$node = $nodeEvent->getNode();
- 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 getProcesses
has 7 arguments (exceeds 6 allowed). Consider refactoring. Open
private function getProcesses($list, $link, $index, $duration, $maxSpace, $lineHeight, $timePrecision)
Function addModule
has a Cognitive Complexity of 9 (exceeds 7 allowed). Consider refactoring. Open
public function addModule($module)
{
if ($module instanceof ModuleInterface) {
if (in_array($module, $this->modules, true)) {
throw new InvalidArgumentException(
- 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 yieldLines
has a Cognitive Complexity of 9 (exceeds 7 allowed). Consider refactoring. Open
private function yieldLines(State $state, array $lines, LineAnalyzer $analyzer)
{
yield $state->createToken(IndentToken::class);
$maxIndent = $analyzer->getMaxIndent();
- 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 9 (exceeds 7 allowed). Consider refactoring. Open
public function scan(State $state)
{
foreach ($state->scanToken(
BlockToken::class,
'block(?:[\t ]+(?<mode>append|prepend|replace))?'.
- 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 formatExpressionElement
has a Cognitive Complexity of 9 (exceeds 7 allowed). Consider refactoring. Open
protected function formatExpressionElement(ExpressionElement $code)
{
$value = $this->formatCode($code->getValue(), $code->isChecked(), !$code->isTransformationAllowed());
if ($code->hasStaticValue()) {
- 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 9 (exceeds 7 allowed). Consider refactoring. Open
public function scan(State $state)
{
$reader = $state->getReader();
if (!$reader->peekChar('<')) {
- 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 compileNode
has a Cognitive Complexity of 9 (exceeds 7 allowed). Consider refactoring. Open
public function compileNode(NodeInterface $node, ElementInterface $parent = null)
{
$compiler = $this->getCompiler();
$compiler->assert(
$node instanceof ElementNode,
- 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 hasDuplicateAttributeNames
has a Cognitive Complexity of 9 (exceeds 7 allowed). Consider refactoring. Open
protected function hasDuplicateAttributeNames(MarkupInterface $element)
{
if ($element instanceof MarkupElement || $element instanceof MixinCallElement) {
$names = [];
foreach ($element->getAttributes() as $attribute) {
- 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 withVariableReference
has a Cognitive Complexity of 9 (exceeds 7 allowed). Consider refactoring. Open
private function withVariableReference(&$variable, $name, $callback)
{
$keys = $this->handleOptionName($name);
if (is_array($keys)) {
foreach (array_slice($keys, 0, -1) as $key) {
- 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"