Showing 183 of 183 total issues
Avoid using short method names like IsNumeric::is(). The configured minimum method name length is 3. Open
public function is(Matrix $mA)
{
return ($mA instanceof NumericMatrix);
}
- Read upRead up
- Exclude checks
ShortMethodName
Since: 0.2
Detects when very short method names are used.
Example
class ShortMethod {
public function a( $index ) { // Violation
}
}
Source https://phpmd.org/rules/naming.html#shortmethodname
Avoid using short method names like IsRational::is(). The configured minimum method name length is 3. Open
public function is(Matrix $mA)
{
return ($mA instanceof RationalMatrix);
}
- Read upRead up
- Exclude checks
ShortMethodName
Since: 0.2
Detects when very short method names are used.
Example
class ShortMethod {
public function a( $index ) { // Violation
}
}
Source https://phpmd.org/rules/naming.html#shortmethodname
Avoid using short method names like IsComplex::is(). The configured minimum method name length is 3. Open
public function is(Matrix $mA)
{
return ($mA instanceof ComplexMatrix);
}
- Read upRead up
- Exclude checks
ShortMethodName
Since: 0.2
Detects when very short method names are used.
Example
class ShortMethod {
public function a( $index ) { // Violation
}
}
Source https://phpmd.org/rules/naming.html#shortmethodname
Avoid using short method names like IsNonsingular::is(). The configured minimum method name length is 3. Open
public function is(Matrix $mA)
{
$this->assertMatrixIsNumeric($mA)
->assertMatrixIsSquare($mA);
- Read upRead up
- Exclude checks
ShortMethodName
Since: 0.2
Detects when very short method names are used.
Example
class ShortMethod {
public function a( $index ) { // Violation
}
}
Source https://phpmd.org/rules/naming.html#shortmethodname
Avoid using short method names like IsIdentity::is(). The configured minimum method name length is 3. Open
public function is(Matrix $mA)
{
if (!$mA instanceof NumericMatrix) {
return false;
}
- Read upRead up
- Exclude checks
ShortMethodName
Since: 0.2
Detects when very short method names are used.
Example
class ShortMethod {
public function a( $index ) { // Violation
}
}
Source https://phpmd.org/rules/naming.html#shortmethodname
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 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 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;
Avoid classes with short names like Lu. Configured minimum length is 3. Open
class Lu extends AbstractDecomposition
{
use CreateCorrectMatrixType;
use CreateCorrectScalarType;
- Read upRead up
- Exclude checks
ShortClassName
Since: 2.9
Detects when classes or interfaces have a very short name.
Example
class Fo {
}
interface Fo {
}
Source https://phpmd.org/rules/naming.html#shortclassname
Avoid classes with short names like Lu. Configured minimum length is 3. Open
class Lu implements DeterminantStrategyInterface
{
/**
* Compute determinant using LU method
* $mA must be
- Read upRead up
- Exclude checks
ShortClassName
Since: 2.9
Detects when classes or interfaces have a very short name.
Example
class Fo {
}
interface Fo {
}
Source https://phpmd.org/rules/naming.html#shortclassname
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
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
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;