Showing 52 of 183 total issues
Function toFloat
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function toFloat(array $dA)
{
foreach ($dA as &$row) {
foreach ($row as &$entry) {
if ($entry instanceof NumericTypeInterface) {
- 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 toInt
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function toInt(array $dA)
{
foreach ($dA as &$row) {
foreach ($row as &$entry) {
if ($entry instanceof NumericTypeInterface) {
- 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 deeply nested control flow statements. Open
if ($comp->eq($ipiv[$k], $zero())) {
$absVal = $dA[$j][$k]->abs();
if ($comp->gt($absVal, $big)) {
unset($big);
$big = clone $absVal;
Function __construct
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($source, $normalizeDefault = 0)
{
if ($source instanceof self) {
$this->store($source->toArray());
return;
- 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 addMultipleOfOtherRowToRow
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function addMultipleOfOtherRowToRow(array &$a, $multiple, $rowToMultiplyWith,
$rowToAddTo, Calculator $calc)
Function __construct
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(IntType $size, IntType $identityType = null)
{
if (is_null($identityType)) {
$idt = self::IDM_TYPE_INT;
} else {
- 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 convertNumberToNumeric
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function convertNumberToNumeric($value)
{
switch(gettype($value)) {
case 'integer':
return TypeFactory::createInt($value);
- 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 invert
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function invert(NumericMatrix $mA)
{
$rows = $mA->rows();
$cols = $mA->columns();
$work = array();
- 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 TypeFactory::createInt(($scalar ? 1 : 0));
Avoid too many return
statements within this method. Open
return $this->transform(new $tName(), $extra);
Avoid too many return
statements within this method. Open
return $mA;
Avoid too many return
statements within this method. Open
return RationalTypeFactory::create($scalar)->asComplex();
Avoid too many return
statements within this method. Open
return RationalTypeFactory::create($value ? 1 : 0, 1);
Avoid too many return
statements within this method. Open
return ComplexTypeFactory::create(($scalar ? 1 : 0), 0);
Avoid too many return
statements within this method. Open
return ComplexTypeFactory::create(($value ? 1 : 0), 0);
Avoid too many return
statements within this method. Open
return TypeFactory::createRational($scalar);
Avoid too many return
statements within this method. Open
return TypeFactory::createRational($scalar);
Avoid too many return
statements within this method. Open
return ComplexTypeFactory::create($scalar);
Avoid too many return
statements within this method. Open
return TypeFactory::createInt(($value ? 1 : 0));
Avoid too many return
statements within this method. Open
return ComplexTypeFactory::create($scalar);