jlawrence11/eos

View on GitHub

Showing 31 of 31 total issues

Function mpMatrix has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function mpMatrix(Matrix $bMatrix)
    {
        if(!$this->_verify() || !$bMatrix->_verify()) {
            // @codeCoverageIgnoreStart
            // Should never get this far
Severity: Minor
Found in src/Matrix.php - About 55 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

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            if((!in_array($match[1], array_merge(self::$ST, self::$ST1, self::$ST2, self::$SEP['open'])) && $match[1] != "") || is_numeric($match[1])) //$this->SEP['close'] removed
                $front = "*";
            else
                $front = "";
Severity: Minor
Found in src/Parser.php and 1 other location - About 50 mins to fix
src/Parser.php on lines 482..485

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 97.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            if((!in_array($match[3], array_merge(self::$ST, self::$ST1, self::$ST2, self::$SEP['close'])) && $match[3] != "") || is_numeric($match[3])) //$this->SEP['open'] removed
                $back = "*";
            else
                $back = "";
Severity: Minor
Found in src/Parser.php and 1 other location - About 50 mins to fix
src/Parser.php on lines 477..480

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 97.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Avoid deeply nested control flow statements.
Open

                        if($jj==$j) {
                            continue;
                        }
Severity: Major
Found in src/Matrix.php - About 45 mins to fix

    Consider simplifying this complex logical expression.
    Open

                if(in_array(strtolower($match[2]), array('pi', 'e'))) {
                    $t = (strtolower($match[2])=='pi') ? pi() : exp(1);
                    $infix = str_replace($match[0], $match[1] . $front. $t. $back . $match[3], $infix);
                } elseif(!isset($vArray[$match[2]]) && (!is_array($vArray != "") && !is_numeric($vArray) && 0 !== $vArray)) {
                    throw new \Exception("Variable replacement does not exist for '". $match[2] ."' in ". self::$inFix .".", Math::E_NO_VAR);
    Severity: Major
    Found in src/Parser.php - About 40 mins to fix

      Function transpose has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function transpose($cArray=false,$asArray=true)
          {
              if(!$cArray) $cArray = $this->matrix;
              if(!$this->isSquare($cArray))
                  throw new \Exception("'{$this}' is not a square matrix", Matrix::E_NOT_SQUARE);
      Severity: Minor
      Found in src/Matrix.php - About 35 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 addMatrix has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function addMatrix(Matrix $nMatrix)
          {
              if(!$this->_verify() || !$nMatrix->_verify())
                  throw new \Exception("Matrices have varying column sizes", Matrix::E_INVALID_MATRIX);
      
      
      Severity: Minor
      Found in src/Matrix.php - About 35 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 subMatrix has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          public function subMatrix(Matrix $nMatrix)
          {
              if(!$this->_verify() || !$nMatrix->_verify())
                  throw new \Exception("Matrices have varying column sizes", Matrix::E_INVALID_MATRIX);
      
      
      Severity: Minor
      Found in src/Matrix.php - About 25 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 log has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function log($input, $vars)
          {
              $base = 10;
              if(stripos($input, ",")) {
                  list($eq, $base) = explode(",", $input);
      Severity: Minor
      Found in src/AdvancedFunctions.php - About 25 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

      TODO found
      Open

      TODO:
      Severity: Minor
      Found in README.md by fixme

      TODO found
      Open

      ## TODO: If you have NuGet Package Restore enabled, uncomment this
      Severity: Minor
      Found in .gitignore by fixme
      Severity
      Category
      Status
      Source
      Language