deivid-rodriguez/byebug

View on GitHub

Showing 40 of 40 total issues

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

  class Manager
    VERSIONS = %w[
      2.5.8
      2.6.6
      2.7.2
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
            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 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 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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      module Byebug
        #
        # Implements the step functionality.
        #
        # Allows the user the continue execution until the next instruction, possibly
      Severity: Minor
      Found in lib/byebug/commands/step.rb and 1 other location - About 55 mins to fix
      lib/byebug/commands/next.rb on lines 6..37

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 46.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      module Byebug
        #
        # Implements the next functionality.
        #
        # Allows the user the continue execution until the next instruction in the
      Severity: Minor
      Found in lib/byebug/commands/next.rb and 1 other location - About 55 mins to fix
      lib/byebug/commands/step.rb on lines 6..37

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 46.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      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 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 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 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 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 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 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

      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

      Severity
      Category
      Status
      Source
      Language