Showing 154 of 154 total issues
Function isUnary
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function isUnary(Node $node, ?Node $lastNode): bool
{
if (!$node instanceof InfixExpressionNode) {
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 parse
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function parse(string|Rational $value, bool $normalize = true): Rational
{
if ($value === '') {
throw new SyntaxErrorException();
}
- 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 compareTo
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function compareTo(Node $other): bool
{
if (!($other instanceof static)) {
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 visitInfixExpressionNode
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function visitInfixExpressionNode(InfixExpressionNode $node): string
{
$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 populateNode
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function populateNode(AbstractOperatorNode $node): Node
{
if ($node instanceof FunctionNode) {
throw new DelimeterMismatchException($node->operator);
}
- 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 rpow
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function rpow($a, $b)
{
if ($b->getDenominator() === 1) {
$n = $b->getNumerator();
if ($n >= 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 numericFactors
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function numericFactors(Node $leftOperand, Node $rightOperand): ?Node
{
if ($this->isNumeric($rightOperand) && (float)$rightOperand->value === 0.0) {
throw new DivisionByZeroException();
}
- 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 tan(deg2rad($inner));
Avoid too many return
statements within this method. Open
return sinh($inner);
Avoid too many return
statements within this method. Open
return cosh($inner);
Avoid too many return
statements within this method. Open
return $this->nodeFactory->multiplication($right->accept($this), $node);
Avoid too many return
statements within this method. Open
return Complex::sinh($z);
Avoid too many return
statements within this method. Open
return Complex::div(Complex::log($z), M_LN10);
Avoid too many return
statements within this method. Open
return Complex::sqrt($z);
Avoid too many return
statements within this method. Open
return new Complex($z->arg(), 0);
Avoid too many return
statements within this method. Open
return asin($inner);
Avoid too many return
statements within this method. Open
return log10($inner);
Avoid too many return
statements within this method. Open
return "($text)";
Avoid too many return
statements within this method. Open
return "$leftValue$operator$rightValue";
Avoid too many return
statements within this method. Open
return "$prepend$text";