Showing 25 of 31 total issues
Consider simplifying this complex logical expression. Open
if(in_array(strtolower($match[2]), array('pi', 'e'))) {
$t = (strtolower($match[2])=='pi') ? pi() : exp(1);
$infix = str_replace($match[0], $match[1] . $front. $t. $back . $match[3], $infix);
} elseif(!isset($vArray[$match[2]]) && (!is_array($vArray != "") && !is_numeric($vArray) && 0 !== $vArray)) {
throw new \Exception("Variable replacement does not exist for '". $match[2] ."' in ". self::$inFix .".", Math::E_NO_VAR);
Function transpose
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function transpose($cArray=false,$asArray=true)
{
if(!$cArray) $cArray = $this->matrix;
if(!$this->isSquare($cArray))
throw new \Exception("'{$this}' is not a square matrix", Matrix::E_NOT_SQUARE);
- 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 addMatrix
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function addMatrix(Matrix $nMatrix)
{
if(!$this->_verify() || !$nMatrix->_verify())
throw new \Exception("Matrices have varying column sizes", Matrix::E_INVALID_MATRIX);
- 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 subMatrix
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function subMatrix(Matrix $nMatrix)
{
if(!$this->_verify() || !$nMatrix->_verify())
throw new \Exception("Matrices have varying column sizes", Matrix::E_INVALID_MATRIX);
- 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 log
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function log($input, $vars)
{
$base = 10;
if(stripos($input, ",")) {
list($eq, $base) = explode(",", $input);
- 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"