Showing 70 of 839 total issues

Avoid too many return statements within this method.
Open

                return $this->scope->getPrimitiveType('Number');
Severity: Major
Found in src/ast/expr/OperatorExpr.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                    return $this->regex();
    Severity: Major
    Found in src/lexer/Tokenizer.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                  return SymbolDecypher::{$this->peek}($this);
      Severity: Major
      Found in src/lexer/Tokenizer.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        return new NumberExpr($content, 'double', 'scientific');
        Severity: Major
        Found in src/parselets/expr/LiteralParselet.php - About 30 mins to fix

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

              public function format(Parser $parser)
              {
                  $first = true;
                  $size = count($this->clauses);
                  $processed = 0;
          Severity: Minor
          Found in src/ast/expr/WhereExpr.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 getEvent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getEvent($char)
              {
                  $event = @$this->event_tree[ord($char)];
                  if (null === $event) {
                      return null;
          Severity: Minor
          Found in src/cli/Console.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 parse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public function parse($grammar, Token $token)
              {
                  $parameters = [];
                  $kind = null;
                  $body = null;
          Severity: Minor
          Found in src/parselets/expr/LambdaParselet.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 check has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public function check(TypeNode $other)
              {
                  $message = Localization::message('TYP350', [$this, $other]);
                  if (!($other instanceof FunctionType)) {
                      return false;
          Severity: Minor
          Found in src/typechecker/FunctionTypeChecker.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 match has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public function match($tag)
              {
                  $hint = null;
          
                  if ($this->lookahead->getTag() === $tag) {
          Severity: Minor
          Found in src/parser/Parser.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 getType has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getType()
              {
                  $size = count($this->keys);
          
                  // Generic type when no initializer provided
          Severity: Minor
          Found in src/ast/expr/MapExpr.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