Showing 113 of 115 total issues
Function __call
has a Cognitive Complexity of 9 (exceeds 7 allowed). Consider refactoring. Open
public function __call($method, $parameters)
{
if ($this instanceof OptionInterface && $this->hasOption('macros')) {
$macros = $this->getOption('macros') ?: [];
if (isset($macros[$method])) {
- 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 isExpired
has a Cognitive Complexity of 9 (exceeds 7 allowed). Consider refactoring. Open
public function isExpired($file, &$cachePath = null)
{
if (isset($this->options['up_to_date_check']) && !$this->options['up_to_date_check']) {
if (func_num_args() > 1) {
$cachePath = $this->getRegistryPath($file);
- 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 loopScan
has a Cognitive Complexity of 9 (exceeds 7 allowed). Consider refactoring. Open
public function loopScan($scanners, $required = false)
{
if ($this->reader->hasLength() && $this->scanners === null) {
$this->scanners = $this->filterScanners($scanners);
}
- 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 analyze
has a Cognitive Complexity of 9 (exceeds 7 allowed). Consider refactoring. Open
public function analyze($quitOnOutdent, array $breakChars = [])
{
$this->outdent = false;
$this->level = $this->state->getLevel();
$this->newLevel = $this->level;
- 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 getIndentLevel
has a Cognitive Complexity of 9 (exceeds 7 allowed). Consider refactoring. Open
public function getIndentLevel(State $state, $maxLevel = INF, callable $getIndentChar = null)
{
if ($maxLevel <= 0) {
return 0;
}
- 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 formatAttributes
has a Cognitive Complexity of 9 (exceeds 7 allowed). Consider refactoring. Open
protected function formatAttributes(MarkupElement $element)
{
if ($this->hasNonStaticAttributes($element) ||
$this->hasDuplicateAttributeNames($element)) {
$empty = 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
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return $this->pattern(
'attribute_pattern',
$this->format($name),
$this->format($value)
);
Avoid too many return
statements within this method. Open
return $this->cache[$cacheKey];
Function scan
has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring. Open
public function scan($scanners, array $options = [])
{
$scanners = $this->filterScanners($scanners);
foreach ($scanners as $scanner) {
- 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 scanParenthesesContent
has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring. Open
private function scanParenthesesContent(State $state, array $options)
{
$reader = $state->getReader();
while ($reader->hasLength()) {
- 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 getUnescapedLines
has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring. Open
protected function getUnescapedLines(State $state, $lines)
{
$buffer = '';
$interpolationLevel = 0;
- 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 getUnescapedLineValue
has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring. Open
protected function getUnescapedLineValue(State $state, $value, &$interpolationLevel, &$buffer)
{
if (is_string($value)) {
if ($interpolationLevel) {
yield $this->unEscapedToken($state, $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"