deivid-rodriguez/byebug

View on GitHub

Showing 29 of 40 total issues

Class Manager has 28 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Manager
    VERSIONS = %w[
      2.5.9
      2.6.10
      2.7.8
Severity: Minor
Found in docker/manager.rb - About 3 hrs to fix

    Class Frame has 24 methods (exceeds 20 allowed). Consider refactoring.
    Open

      class Frame
        include Helpers::FileHelper
    
        attr_reader :pos
    
    
    Severity: Minor
    Found in lib/byebug/frame.rb - About 2 hrs to fix

      Method start has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

            def start(host = "localhost", port = PORT)
              connect_at(host, port)
      
              while (line = socket.gets)
                case line
      Severity: Minor
      Found in lib/byebug/remote/client.rb - 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 execute has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          def execute
            key = @match[:setting]
            value = @match[:value]
            return puts(help) if key.nil? && value.nil?
      
      
      Severity: Minor
      Found in lib/byebug/commands/set.rb - 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 execute has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def execute
            if @match[1]
              pos, err = get_int(@match[1], "Undisplay", 1, Byebug.displays.size)
              return errmsg(err) unless err.nil?
      
      
      Severity: Minor
      Found in lib/byebug/commands/undisplay.rb - 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 execute has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def execute
            if until_line?
              num, err = get_int(modifier, "Continue", 0, nil)
              return errmsg(err) unless num
      
      
      Severity: Minor
      Found in lib/byebug/commands/continue.rb - 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 execute has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def execute
            unless @match[1]
              Byebug.breakpoints.clear if confirm(pr("break.confirmations.delete_all"))
      
              return
      Severity: Minor
      Found in lib/byebug/commands/delete.rb - 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 syntax_valid? has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

            def syntax_valid?(code)
              return true unless code
      
              if defined?(RubyVM::InstructionSequence.compile)
                without_stderr do
      Severity: Minor
      Found in lib/byebug/helpers/parse.rb - 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 execute has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def execute
            return info unless @match[1]
      
            return @match[1] == "off" ? clear : add(@match[1]) unless @match[2]
      
      
      Severity: Minor
      Found in lib/byebug/commands/catch.rb - 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

      Method locate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

            def locate(path)
              result = nil
              contents.each_value do |contents|
                result = parts(path).reduce(contents) do |r, part|
                  r&.key?(part) ? r[part] : nil
      Severity: Minor
      Found in lib/byebug/printers/base.rb - 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

      Method start has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

            def start(host, port)
              return if @thread
      
              if wait_connection
                mutex = Mutex.new
      Severity: Minor
      Found in lib/byebug/remote/server.rb - 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

      Method navigate_to_frame has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

            def navigate_to_frame(jump_no)
              current_jumps = 0
              current_pos = context.frame.pos
      
              loop do
      Severity: Minor
      Found in lib/byebug/helpers/frame.rb - 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

      Method execute has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def execute
            if @match[1]
              signame = @match[1]
      
              return errmsg("signal name #{signame} is not a signal I know about\n") unless Signal.list.member?(signame)
      Severity: Minor
      Found in lib/byebug/commands/kill.rb - 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

      Method execute has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def execute
            return puts(help) unless @match[1]
      
            breakpoints = Byebug.breakpoints.sort_by(&:id)
            return errmsg(pr("condition.errors.no_breakpoints")) if breakpoints.empty?
      Severity: Minor
      Found in lib/byebug/commands/condition.rb - 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

      Method info_breakpoint has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

            def info_breakpoint(brkpt)
              interp = format(
                "%-<id>3d %-<status>3s at %<file>s:%<line>s%<expression>s",
                id: brkpt.id,
                status: brkpt.enabled? ? "y" : "n",
      Severity: Minor
      Found in lib/byebug/commands/info/breakpoints.rb - 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

      Method parse_range has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def parse_range(input)
            first, err = get_int(lower_bound(input), "List", 1, max_line)
            raise(err) unless first
      
            if upper_bound(input)
      Severity: Minor
      Found in lib/byebug/commands/list.rb - 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

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

          def line_breakpoint(location)
            line_match = location.match(/^(\d+)$/)
            file_line_match = location.match(/^(.+):(\d+)$/)
            return unless line_match || file_line_match
      
      
      Severity: Minor
      Found in lib/byebug/commands/break.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 execute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def execute
            if @match[1]
              n_frames, err = get_int(@match[1], "finish", 0, max_frames - 1)
              return errmsg(err) unless n_frames
            else
      Severity: Minor
      Found in lib/byebug/commands/finish.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 enable_disable_breakpoints has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

            def enable_disable_breakpoints(is_enable, args)
              raise pr("toggle.errors.no_breakpoints") if Breakpoint.none?
      
              select_breakpoints(is_enable, args).each do |b|
                enabled = (is_enable == "enable")
      Severity: Minor
      Found in lib/byebug/helpers/toggle.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 find has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

            def find(shortcut)
              abbr = /^no/.match?(shortcut) ? shortcut[2..-1] : shortcut
              matches = settings.select do |key, value|
                key =~ (value.boolean? ? /#{abbr}/ : /#{shortcut}/)
              end
      Severity: Minor
      Found in lib/byebug/setting.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

      Severity
      Category
      Status
      Source
      Language