Showing 28 of 42 total issues
ComparisonNode
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
class ComparisonNode implements Node
{
private $identifier;
private $operator;
private $value;
Function isSatisfiedBy
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function isSatisfiedBy($value) : bool
{
if (empty($this->children)) {
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
Method parseComparisonExpression
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function parseComparisonExpression() : Ast\Node
{
$left = $this->parseIdentifier();
$negated = false;
Function parseComparisonExpression
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function parseComparisonExpression() : Ast\Node
{
$left = $this->parseIdentifier();
$negated = 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
Method next
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function next() : void
{
$char = $this->advance();
switch ($char) {
Method visitLogical
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function visitLogical(LogicalNode $node) : void
{
$left = $node->left();
$right = $node->right();
Method parseLiteralList
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function parseLiteralList() : Ast\LiteralNodeList
{
$this->match(Token::LEFT_BRACKET);
$this->next();
Function visitComparison
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function visitComparison(ComparisonNode $node) : void
{
$node->identifier()->accept($this);
$negated = $this->negating;
- 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 visitComparison
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function visitComparison(ComparisonNode $node) : void
{
$node->identifier()->accept($this);
$negated = $this->negating;
Function visitLogical
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function visitLogical(Ast\LogicalNode $node) : void
{
$node->right()->accept($this);
$node->left()->accept($this);
- 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 blockComment
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function blockComment() : void
{
/* This kind of comment continues until it is closed. It can also be nested. */
$balance = 1;
- 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 string
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function string()
{
$buffer = '';
while ($this->peek() !== '"' && !$this->eof()) {
- 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 isSatisfiedBy
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function isSatisfiedBy($value) : bool
{
if (empty($this->candidates)) {
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 parseLiteralList
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function parseLiteralList() : Ast\LiteralNodeList
{
$this->match(Token::LEFT_BRACKET);
$this->next();
- 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 new TimezoneMatches($candidate);
Avoid too many return
statements within this method. Open
return $value <= $this->string;
Avoid too many return
statements within this method. Open
case self::CONTAINS_ALL: return 'contains all';
Avoid too many return
statements within this method. Open
return $value >= $this->string;
Avoid too many return
statements within this method. Open
return $value >= $this->date;
Avoid too many return
statements within this method. Open
return $equal || $value > $this->number;