whitequark/parser

View on GitHub

Showing 93 of 93 total issues

Method keyword_cmd has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def keyword_cmd(type, keyword_t, lparen_t=nil, args=[], rparen_t=nil)
Severity: Minor
Found in lib/parser/builders/default.rb - About 35 mins to fix

    Method ternary_map has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def ternary_map(begin_e, question_t, mid_e, colon_t, end_e)
    Severity: Minor
    Found in lib/parser/builders/default.rb - About 35 mins to fix

      Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def initialize(level, reason, arguments, location, highlights=[])
      Severity: Minor
      Found in lib/parser/diagnostic.rb - About 35 mins to fix

        Method endless_definition_map has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def endless_definition_map(keyword_t, operator_t, name_t, assignment_t, body_e)
        Severity: Minor
        Found in lib/parser/builders/default.rb - About 35 mins to fix

          Method diagnostic has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def diagnostic(type, reason, arguments, location, highlights=[])
          Severity: Minor
          Found in lib/parser/builders/default.rb - About 35 mins to fix

            Method ternary has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def ternary(cond, question_t, if_true, colon_t, if_false)
            Severity: Minor
            Found in lib/parser/builders/default.rb - About 35 mins to fix

              Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                    def initialize(keyword_l, begin_l, else_l, end_l, expression_l)
              Severity: Minor
              Found in lib/parser/source/map/condition.rb - About 35 mins to fix

                Method block has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def block(method_call, begin_t, args, body, end_t)
                Severity: Minor
                Found in lib/parser/builders/default.rb - About 35 mins to fix

                  Method eh_keyword_map has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def eh_keyword_map(compstmt_e, keyword_t, body_es,
                                         else_t, else_e)
                  Severity: Minor
                  Found in lib/parser/builders/default.rb - About 35 mins to fix

                    Method def_endless_method has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def def_endless_method(def_t, name_t, args,
                                               assignment_t, body)
                    Severity: Minor
                    Found in lib/parser/builders/default.rb - About 35 mins to fix

                      Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                            def initialize(dot_l, selector_l, begin_l, end_l, expression_l)
                      Severity: Minor
                      Found in lib/parser/source/map/send.rb - About 35 mins to fix

                        Method process has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def process(initial_buffer)
                              buffer = initial_buffer
                              original_name = buffer.name
                        
                              @rewriters.each do |rewriter_class|
                        Severity: Minor
                        Found in lib/parser/runner/ruby_rewrite.rb - 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

                        Method match_hash_var_from_str has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def match_hash_var_from_str(begin_t, strings, end_t)
                              if strings.length > 1
                                diagnostic :error, :pm_interp_in_var_name, nil, loc(begin_t).join(loc(end_t))
                              end
                        
                        
                        Severity: Minor
                        Found in lib/parser/builders/default.rb - 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

                        Method condition_map has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def condition_map(keyword_t, cond_e, begin_t, body_e, else_t, else_e, end_t)
                              if end_t
                                end_l = loc(end_t)
                              elsif else_e && else_e.loc.expression
                                end_l = else_e.loc.expression
                        Severity: Minor
                        Found in lib/parser/builders/default.rb - 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

                        Method merge_replacements has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                              def merge_replacements(actions)
                                result    = ''.dup
                                prev_act  = nil
                        
                                actions.each do |act|
                        Severity: Minor
                        Found in lib/parser/source/rewriter.rb - 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

                        Method collection_map has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def collection_map(begin_t, parts, end_t)
                              if begin_t.nil? || end_t.nil?
                                if parts.any?
                                  expr_l = join_exprs(parts.first, parts.last)
                                elsif !begin_t.nil?
                        Severity: Minor
                        Found in lib/parser/builders/default.rb - 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

                        Method static_string has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def static_string(nodes)
                              nodes.map do |node|
                                case node.type
                                when :str
                                  node.children[0]
                        Severity: Minor
                        Found in lib/parser/builders/default.rb - 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

                        Method render_line has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def render_line(range, ellipsis=false, range_end=false)
                              source_line    = range.source_line
                              highlight_line = ' ' * source_line.length
                        
                              @highlights.each do |highlight|
                        Severity: Minor
                        Found in lib/parser/diagnostic.rb - 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

                        Method action_summary has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                              def action_summary
                                replacements = as_replacements
                                case replacements.size
                                when 0 then return 'empty'
                                when 1..3 then #ok
                        Severity: Minor
                        Found in lib/parser/source/tree_rewriter.rb - 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

                        Method procarg0 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def procarg0(arg)
                              if self.class.emit_procarg0
                                if arg.type == :arg && self.class.emit_arg_inside_procarg0
                                  n(:procarg0, [ arg ],
                                    Source::Map::Collection.new(nil, nil, arg.location.expression))
                        Severity: Minor
                        Found in lib/parser/builders/default.rb - 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