Showing 54 of 54 total issues
Method parseBlock
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parseBlock()
{
$block = $this->expect('block');
$mode = $block->mode;
$name = trim($block->value);
Method __construct
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(array $options = null)
{
if (is_null($options)) {
$options = defined('static::SETTINGS') ? ((array) static::SETTINGS) : array();
}
Method parseSpace
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
public function parseSpace(&$states, $state, $interpolate, $escapedAttribute, &$val, &$key, $char, $previousNonBlankChar, $nextChar)
Method getAndAttributeCode
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getAndAttributeCode($attr, &$classes, &$classesCheck)
{
$addClasses = '""';
if (count($classes) || count($classesCheck)) {
foreach ($classes as &$value) {
Function parseMixinAttributes
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function parseMixinAttributes($attributes, $defaultAttributes, $mixinAttributes)
{
if (!count($attributes)) {
return "(isset(\$attributes)) ? \$attributes : array($defaultAttributes)";
}
- 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 5 allowed). Consider refactoring. Open
public function __construct(array $options = null)
{
if (is_null($options)) {
$options = defined('static::SETTINGS') ? ((array) static::SETTINGS) : array();
}
- 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 parseTextBlock
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parseTextBlock()
{
$block = new Nodes\Block();
$block->line = $this->line();
$spaces = $this->expect('indent')->value;
Function parse
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function parse()
{
$block = new Nodes\Block();
$block->line = $this->line();
- 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 parseTextBlock
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function parseTextBlock()
{
$block = new Nodes\Block();
$block->line = $this->line();
$spaces = $this->expect('indent')->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
Avoid deeply nested control flow statements. Open
if ($quote) {
if (CommonUtils::escapedEnd($match[1])) {
${is_null($value) ? 'key' : 'value'} .= $match[0];
$consume($argument, $match[0]);
break;
Function parseMixinArguments
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function parseMixinArguments(&$arguments, &$containsOnlyArrays, &$defaultAttributes)
{
$newArrayKey = null;
$arguments = is_null($arguments) ? array() : explode(',', $arguments);
foreach ($arguments as $key => &$argument) {
- 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 parseInclude
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function parseInclude()
{
$token = $this->expect('include');
$file = trim($token->value);
$dir = realpath(dirname($this->filename));
- 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 deeply nested control flow statements. Open
if (!is_null($value)) {
throw new \Exception('Parse error on '.substr($argument, strlen($match[1])), 1);
}
Avoid deeply nested control flow statements. Open
if ($quote) {
${is_null($value) ? 'key' : 'value'} .= $match[0];
break;
}
Function parseSpace
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function parseSpace(&$states, $state, $interpolate, $escapedAttribute, &$val, &$key, $char, $previousNonBlankChar, $nextChar)
{
switch ($state()) {
case 'expr':
case 'array':
- 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 displayAttributes
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function displayAttributes($attributes, $quote)
{
if (is_array($attributes) || $attributes instanceof Traversable) {
foreach ($attributes as $key => $value) {
if ($key !== 'class' && $value !== false && $value !== 'null') {
- 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 deeply nested control flow statements. Open
if ($quote) {
${is_null($value) ? 'key' : 'value'} .= $match[0];
$consume($argument, $match[0]);
break;
}
Function handleString
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function handleString($input)
{
$result = array();
$resultsString = array();
- 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 isArrayOfConstants
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function isArrayOfConstants($str)
{
$str = trim($str);
if (0 === strpos($str, 'array(') || 0 === strpos($str, '[')) {
- 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 visitCodeConditional
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function visitCodeConditional(array $matches)
{
$code = trim($matches[2], '; ');
while (($len = strlen($code)) > 1 && ($code[0] == '(' || $code[0] == '{') && ord($code[0]) == ord(substr($code, -1)) - 1) {
$code = trim(substr($code, 1, $len - 2));
- 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"