j84reginato/my-eval

View on GitHub

Showing 147 of 154 total issues

Avoid too many return statements within this method.
Open

                    return new RationalNode(Math::semiFactorial($inner->getNumerator()), 1);
Severity: Major
Found in src/Solving/RationalEvaluator.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return $this->processNumericNodeType($leftOperand, $rightOperand);
    Severity: Major
    Found in src/Parsing/Operations/Math/MultiplicationOperation.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                      return exp($inner);
      Severity: Major
      Found in src/Solving/StdMathEvaluator.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        return floor($inner);
        Severity: Major
        Found in src/Solving/StdMathEvaluator.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                          return "$leftValue>$rightValue";
          Severity: Major
          Found in src/Solving/ASCIIPrinter.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                            return $this->nodeFactory->division($inner, new FunctionNode('sqrt', $temp));
            Severity: Major
            Found in src/Solving/Differentiator.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                              return $this->nodeFactory->division($inner, $denominator);
              Severity: Major
              Found in src/Solving/Differentiator.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                        return $this->nodeFactory->multiplication($inner, $df);
                Severity: Major
                Found in src/Solving/Differentiator.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                  return Complex::arcsin($z);
                  Severity: Major
                  Found in src/Solving/ComplexEvaluator.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                    return Complex::exp($z);
                    Severity: Major
                    Found in src/Solving/ComplexEvaluator.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                          return new RationalNode(Math::factorial($inner->getNumerator()), 1);
                      Severity: Major
                      Found in src/Solving/RationalEvaluator.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                    return $other->getLeft() === null && $this->right->compareTo($other->getRight());
                        Severity: Major
                        Found in src/Parsing/Nodes/Operator/AbstractExpressionNode.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                  return $this->left->compareTo($other->getLeft()) && $this->right->compareTo($other->getRight());
                          Severity: Major
                          Found in src/Parsing/Nodes/Operator/AbstractExpressionNode.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                            return 1 / $tan_inner;
                            Severity: Major
                            Found in src/Solving/StdMathEvaluator.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                              return atan($inner);
                              Severity: Major
                              Found in src/Solving/StdMathEvaluator.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                                return exp($logGamma);
                                Severity: Major
                                Found in src/Solving/StdMathEvaluator.php - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                                      return $this->nodeFactory->multiplication(
                                                          new FloatNode($exponent->value),
                                                          $this->nodeFactory->multiplication($fpow, $base->accept($this))
                                                      );
                                  Severity: Major
                                  Found in src/Solving/Differentiator.php - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                                        return $this->nodeFactory->multiplication(
                                                            $exponent,
                                                            $this->nodeFactory->multiplication($fpow, $base->accept($this))
                                                        );
                                    Severity: Major
                                    Found in src/Solving/Differentiator.php - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                                      return '\frac{' . $left->accept($this) . '}{' . $right->accept($this) . '}';
                                      Severity: Major
                                      Found in src/Solving/LaTeXPrinter.php - About 30 mins to fix

                                        Function visitFunctionNode has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            public function visitFunctionNode(FunctionNode $node): float|int
                                            {
                                                if ($node->operand === null) {
                                                    throw new NullOperandException();
                                                }
                                        Severity: Minor
                                        Found in src/Solving/StdMathEvaluator.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

                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language