Showing 70 of 839 total issues

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

function getCroakBuffer()
{
    $packing_method = 'S';
    $croak = realpath(dirname(__FILE__) . '/resource/quack.wav');
    $handle = fopen($croak, 'rb');
Severity: Minor
Found in build.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 main has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def main(args):
    """
    Entry point
    """
    try:
Severity: Minor
Found in tools/testsuite/run-tests.py - 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 handleListDefinitions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function handleListDefinitions()
    {
        $renderer = new CliColorizer();
        $context = $this->state('scope')->child;

Severity: Minor
Found in src/cli/Repl.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 _expr has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function _expr($precedence = 0, $opt = false)
    {
        $token = $this->reader->lookahead;
        $prefix = $this->prefixParseletForToken($token);

Severity: Minor
Found in src/parser/ExprParser.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

Avoid too many return statements within this method.
Open

                return 'xor';
Severity: Major
Found in src/lexer/Tag.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                    return static::tryMatch($context, ['%{']);
    Severity: Major
    Found in src/lexer/SymbolDecypher.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                      return $bool;
      Severity: Major
      Found in src/ast/expr/OperatorExpr.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        return static::fetch($context, $context->peek);
        Severity: Major
        Found in src/lexer/SymbolDecypher.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, 'int', 'binary');
            Severity: Major
            Found in src/parselets/expr/LiteralParselet.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

                Avoid too many return statements within this method.
                Open

                                return $op;
                Severity: Major
                Found in src/lexer/Tag.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

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

                    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 static::tryMatch($context, ['=~']);
                      Severity: Major
                      Found in src/lexer/SymbolDecypher.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                        return static::tryMatch($context, ['&{', '&(']);
                        Severity: Major
                        Found in src/lexer/SymbolDecypher.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                          return static::tryMatch($context, ['#{', '#(']);
                          Severity: Major
                          Found in src/lexer/SymbolDecypher.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 new Token(self::EOF_TYPE);
                              Severity: Major
                              Found in src/lexer/Tokenizer.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                            return $bool;
                                Severity: Major
                                Found in src/ast/expr/OperatorExpr.php - About 30 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language