Showing 178 of 188 total issues
Function canFactorsInImplicitMultiplication
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function canFactorsInImplicitMultiplication($token1, $token2)
{
if ($token1 === null || $token2 === null) return false;
$check1 = (
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
protected function numericTerms($leftOperand, $rightOperand)
{
if ($this->isNumeric($leftOperand) && $leftOperand->getValue() == 0) return $rightOperand;
if ($this->isNumeric($rightOperand) && $rightOperand->getValue() == 0) return $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"
Further reading
Function lanczosApproximation
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static function lanczosApproximation($x) {
$g = 7;
$p = array(0.99999999999980993, 676.5203681218851, -1259.1392167224028,
771.32342877765313, -176.61502916214059, 12.507343278686905,
-0.13857109526572012, 9.9843695780195716e-6, 1.5056327351493116e-7);
- 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 visitFactorialNode
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function visitFactorialNode(FunctionNode $node)
{
$functionName = $node->getName();
$op = $node->getOperand();
$operand = $op->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 __construct
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function __construct($left, $operator = null, $right = null)
{
$this->left = $this->sanitize($left);
$this->operator = $operator;
$this->right = $this->sanitize($right);
- 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 complexity
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function complexity()
{
if ($this instanceof IntegerNode || $this instanceof VariableNode || $this instanceof ConstantNode) {
return 1;
} elseif ($this instanceof RationalNode || $this instanceof NumberNode) {
- 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 true;
Avoid too many return
statements within this method. Open
return $this->nodeFactory->multiplication($power, $this->nodeFactory->multiplication($fpow, $leftValue));
Avoid too many return
statements within this method. Open
return $this->nodeFactory->division($inner, $denominator);
Avoid too many return
statements within this method. Open
return Complex::div($a, $b);
Avoid too many return
statements within this method. Open
return Complex::tanh($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 $this->visitFactorialNode($node);
Avoid too many return
statements within this method. Open
return '\infty{}';
Avoid too many return
statements within this method. Open
return "$prepend$text";
Avoid too many return
statements within this method. Open
return atanh(1 / $inner);
Avoid too many return
statements within this method. Open
return false;
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 $result;