chippyash/Math-Matrix

View on GitHub

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);
    }

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);
    }

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);
    }

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);

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;
        }

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) {
Severity: Minor
Found in src/Chippyash/Math/Matrix/NumericMatrix.php - About 1 hr to fix

    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);
    Severity: Minor
    Found in src/Chippyash/Math/Matrix/Traits/ConvertNumberToNumeric.php - About 1 hr to fix

      Method validateArguments has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function validateArguments(array $args)
          {
              $valA = new HasTypeMap([
                      'x' => 'integer'
                  ]
      Severity: Minor
      Found in src/Chippyash/Math/Matrix/Special/Cauchy.php - About 1 hr to fix

        Method validateArguments has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function validateArguments(array $args)
            {
                $valA = new HasTypeMap([
                        'x' => 'integer'
                    ]
        Severity: Minor
        Found in src/Chippyash/Math/Matrix/Special/Chebspec.php - About 1 hr to fix

          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();
          Severity: Minor
          Found in src/Chippyash/Math/Matrix/Decomposition/Lu.php - About 1 hr to fix

            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;
                    }
            Severity: Minor
            Found in src/Chippyash/Math/Matrix/Attribute/IsIdentity.php - About 1 hr to fix

            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;
            Severity: Minor
            Found in src/Chippyash/Math/Matrix/Decomposition/Lu.php - About 1 hr to fix

              Avoid classes with short names like Lu. Configured minimum length is 3.
              Open

              class Lu extends AbstractDecomposition
              {
                  use CreateCorrectMatrixType;
                  use CreateCorrectScalarType;
              
              

              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

              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) {
              Severity: Minor
              Found in src/Chippyash/Math/Matrix/NumericMatrix.php - About 45 mins to fix

              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) {
              Severity: Minor
              Found in src/Chippyash/Math/Matrix/Formatter/AsciiNumeric.php - About 45 mins to fix

              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) {
              Severity: Minor
              Found in src/Chippyash/Math/Matrix/Formatter/AsciiNumeric.php - About 45 mins to fix

              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) {
              Severity: Minor
              Found in src/Chippyash/Math/Matrix/Formatter/AsciiNumeric.php - About 45 mins to fix

              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) {
              Severity: Minor
              Found in src/Chippyash/Math/Matrix/Formatter/AsciiNumeric.php - About 45 mins to fix

              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;
              Severity: Major
              Found in src/Chippyash/Math/Matrix/Decomposition/GaussJordanElimination.php - About 45 mins to fix
                Severity
                Category
                Status
                Source
                Language