Showing 52 of 183 total issues
Function decompose
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function decompose(NumericMatrix $mA, $extra = null)
{
$this->assertParameterIsMatrix($extra, 'Parameter extra is not a matrix')
->assertMatrixIsNumeric($extra, 'Parameter extra is not a numeric matrix')
->assertMatrixIsSquare($mA,
- 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 createCorrectScalarType
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
protected function createCorrectScalarType(NumericMatrix $originalMatrix , $scalar)
{
if ($scalar instanceof NumericTypeInterface) {
if ($originalMatrix instanceof RationalMatrix) {
return $scalar->asRational();
- 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 LUDecomposition
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
protected function LUDecomposition(NumericMatrix $mA)
{
// Use a "left-looking", dot-product, Crout/Doolittle algorithm.
$LU = $mA->toArray();
$m = $this->rows = $mA->rows();
- 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 createRational
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public static function createRational(array $data)
{
foreach ($data as &$row) {
foreach ($row as &$item) {
if (!$item instanceof RationalType) {
- 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 createComplex
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public static function createComplex(array $data)
{
foreach ($data as &$row) {
foreach ($row as &$item) {
if (!$item instanceof ComplexType) {
- 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 checkEntryEquality
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
protected function checkEntryEquality(Matrix $mB, $strict)
{
if ($strict) {
if (get_class($this) !== get_class($mB)) {
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
Method decompose
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function decompose(NumericMatrix $mA, $extra = null)
{
$this->assertParameterIsMatrix($extra, 'Parameter extra is not a matrix')
->assertMatrixIsNumeric($extra, 'Parameter extra is not a numeric matrix')
->assertMatrixIsSquare($mA,
Method format
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function format(Matrix $mA, array $options = array())
{
if (!$mA instanceof NumericMatrix) {
throw new \InvalidArgumentException('Matrix is not NumericMatrix');
}
Method LUDecomposition
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function LUDecomposition(NumericMatrix $mA)
{
// Use a "left-looking", dot-product, Crout/Doolittle algorithm.
$LU = $mA->toArray();
$m = $this->rows = $mA->rows();
Method createCorrectScalarType
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function createCorrectScalarType(NumericMatrix $originalMatrix , $scalar)
{
if ($scalar instanceof NumericTypeInterface) {
if ($originalMatrix instanceof RationalMatrix) {
return $scalar->asRational();
Method convertNumberToNumeric
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function convertNumberToNumeric($value)
{
switch(gettype($value)) {
case 'integer':
return TypeFactory::createInt($value);
Method __invoke
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __invoke()
{
//argument arbitrage
$numArgs = func_num_args();
if ($numArgs == 1) {
Method validateArguments
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function validateArguments(array $args)
{
$valA = new HasTypeMap([
'x' => 'integer'
]
Method validateArguments
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function validateArguments(array $args)
{
$valA = new HasTypeMap([
'x' => 'integer'
]
Method setLowerProduct
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function setLowerProduct(NumericMatrix $mA)
{
$m = $this->LU->rows();
$n = $this->LU->columns();
$LU = $this->LU->toArray();
Function is
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function is(Matrix $mA)
{
if (!$mA instanceof NumericMatrix) {
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
Method setUpperProduct
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function setUpperProduct(NumericMatrix $mA)
{
$n = $this->LU->columns();
$LU = $this->LU->toArray();
$rcFactor = $this->cols -$this->rows;
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
Function toComplex
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function toComplex(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;