Showing 147 of 154 total issues
Function visitFactorialNode
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function visitFactorialNode(FunctionNode $node): string
{
$functionName = $node->operator;
$operand = $node->operand;
$op = $operand->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 visitInfixExpressionNode
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function visitInfixExpressionNode(InfixExpressionNode $node)
{
$left = $node->getLeft();
$operator = $node->operator;
$right = $node->getRight();
- 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 handleCloseParenthesis
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function handleCloseParenthesis(): void
{
// Flag, checking for mismatching parentheses.
$clean = 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 visitFunctionNode
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function visitFunctionNode(FunctionNode $node): RationalNode
{
if ($node->operand === null) {
throw new NullOperandException();
}
- 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 handleInfixOperator
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function handleInfixOperator(InfixExpressionNode $node, Token $token, ?Node $lastNode): void
{
// Check for unary minus and unary plus.
if ($this->isUnary($node, $lastNode)) {
// Unary +, just ignore it.
- 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 numericTerms
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function numericTerms(Node $leftOperand, Node $rightOperand): ?Node
{
if ($this->isNumeric($leftOperand) && (float)$leftOperand->value === 0.0) {
return $rightOperand;
}
- 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 numericExponent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function numericExponent(Node $leftOperand, Node $rightOperand): ?Node
{
// 0^0 throws an exception
if (
$this->isNumeric($leftOperand) &&
- 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"