Showing 70 of 839 total issues

Function injectScope has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function injectScope($parent_scope)
    {
        if (!$this->is_explicit) {
            // Check if there is an implicit label
            $label = $parent_scope->getMetaInContext(Meta::M_LABEL);
Severity: Minor
Found in src/ast/stmt/BreakStmt.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 format has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function format(Parser $parser)
    {
        $source = '&';

        switch (count($this->parameters)) {
Severity: Minor
Found in src/ast/expr/LambdaExpr.php - About 1 hr to fix

    Method bundle has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function bundle($config)
    {
        // Configuration
        $bundle = $config['bundle'];
        $resources = $config['resources'];
    Severity: Minor
    Found in build.php - About 1 hr to fix

      Function readFiles has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          public function readFiles()
          {
              $abstractions = [];
              $classes = [];
              $handle = opendir($this->path);
      Severity: Minor
      Found in build.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 nextToken has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function nextToken()
          {
              while ($this->peek != self::EOF) {
                  if (ctype_digit($this->peek)) {
                      return $this->digit();
      Severity: Minor
      Found in src/lexer/Tokenizer.php - About 1 hr to fix

        Method _stmt has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function _stmt()
            {
                $stmt_list = [
                    Tag::T_IF       => '_ifStmt',
                    Tag::T_LET      => '_letStmt',
        Severity: Minor
        Found in src/parser/StmtParser.php - About 1 hr to fix

          Method __construct has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function __construct($input)
              {
                  $this->size = strlen($input);
          
                  if ($this->size === 0) {
          Severity: Minor
          Found in src/lexer/Lexer.php - About 1 hr to fix

            Method parse has 31 lines of code (exceeds 25 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 1 hr to fix

              Method injectScope has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function injectScope($parent_scope)
                  {
                      $this->scope = $parent_scope;
                      $this->left->injectScope($parent_scope);
              
              
              Severity: Minor
              Found in src/ast/expr/OperatorExpr.php - About 1 hr to fix

                Method handleListDefinitions has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function handleListDefinitions()
                    {
                        $renderer = new CliColorizer();
                        $context = $this->state('scope')->child;
                
                
                Severity: Minor
                Found in src/cli/Repl.php - About 1 hr to fix

                  Method regex has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function regex()
                      {
                          $buffer = [];
                          $buffer[] = $this->readChar();
                          $buffer[] = $this->readChar();
                  Severity: Minor
                  Found in src/lexer/Tokenizer.php - About 1 hr to fix

                    Method render has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function render()
                        {
                            $line = implode('', $this->state('line'));
                            $column = $this->state('column');
                    
                    
                    Severity: Minor
                    Found in src/cli/Repl.php - About 1 hr to fix

                      Method getPartialOperators has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function & getPartialOperators()
                          {
                              static $op_table = [
                                  '+',
                                  '-',
                      Severity: Minor
                      Found in src/lexer/Tag.php - About 1 hr to fix

                        Method format has 27 lines of code (exceeds 25 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 1 hr to fix

                          Method __construct has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function __construct(Tokenizer $input)
                              {
                                  parent::__construct($input);
                                  $name_parser = new NameParser($this);
                                  $type_parser = new TypeParser($this);
                          Severity: Minor
                          Found in src/parser/TokenReader.php - About 1 hr to fix

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

                                public function format(Parser $parser)
                                {
                                    $source = '&';
                            
                                    switch (count($this->parameters)) {
                            Severity: Minor
                            Found in src/ast/expr/LambdaExpr.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

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

                                public function getType()
                                {
                                    $left_type = $this->left->getType();
                                    $index_type = $this->index->getType();
                            
                            
                            Severity: Minor
                            Found in src/ast/expr/AccessExpr.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

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

                                private function compile($source, $silent = false)
                                {
                                    if ('' === $source) {
                                        $this->resetState();
                                        return;
                            Severity: Minor
                            Found in src/cli/Repl.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

                            Function regex has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private function regex()
                                {
                                    $buffer = [];
                                    $buffer[] = $this->readChar();
                                    $buffer[] = $this->readChar();
                            Severity: Minor
                            Found in src/lexer/Tokenizer.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 check has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function check(TypeNode $other)
                                {
                                    if (!($other instanceof MapType)) {
                                        return false;
                                    }
                            Severity: Minor
                            Found in src/typechecker/MapTypeChecker.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

                            Severity
                            Category
                            Status
                            Source
                            Language