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
Function __invoke
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function __invoke()
{
//argument arbitrage
$numArgs = func_num_args();
if ($numArgs == 1) {
- 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 toRational
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function toRational(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
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 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
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
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);
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 ComplexTypeFactory::fromString($value)->asRational();
Avoid too many return
statements within this method. Open
return $mA;
Avoid too many return
statements within this method. Open
return TypeFactory::createRational($scalar);
Avoid too many return
statements within this method. Open
return TypeFactory::createInt(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 RationalTypeFactory::create($value ? 1 : 0, 1);
Avoid too many return
statements within this method. Open
return TypeFactory::createInt($scalar);
Avoid too many return
statements within this method. Open
return RationalTypeFactory::create(0, 1);