AndyObtiva/puts_debuggerer

View on GitHub

Showing 7 of 7 total issues

Method pd has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def pd(*objects)
    options = PutsDebuggerer.determine_options(objects) || {}
    object = PutsDebuggerer.determine_object(objects)
    run_at = PutsDebuggerer.determine_run_at(options)
    printer = PutsDebuggerer.determine_printer(options)
Severity: Major
Found in lib/puts_debuggerer/core_ext/kernel.rb - About 2 hrs to fix

    Method pd has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

      def pd(*objects)
        options = PutsDebuggerer.determine_options(objects) || {}
        object = PutsDebuggerer.determine_object(objects)
        run_at = PutsDebuggerer.determine_run_at(options)
        printer = PutsDebuggerer.determine_printer(options)
    Severity: Minor
    Found in lib/puts_debuggerer/core_ext/kernel.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 caller has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def caller(*args)
          dup_args = args.dup
          start = args.shift if args.first.is_a?(Integer)
          length = args.shift if args.first.is_a?(Integer)
          range = args.shift if args.first.is_a?(Range)
    Severity: Minor
    Found in lib/puts_debuggerer/core_ext/kernel.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 __build_pd_data__ has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

      def __build_pd_data__(object, print_engine_options:nil, source_line_count:nil, run_number:nil, pd_inspect:false, logger_formatter_decorated:false, logging_layouts_decorated:false)
        depth = RUBY_ENGINE == 'opal' ? PutsDebuggerer::CALLER_DEPTH_ZERO_OPAL : PutsDebuggerer::CALLER_DEPTH_ZERO
        if pd_inspect
          depth += 1
          depth += 4 if logger_formatter_decorated
    Severity: Minor
    Found in lib/puts_debuggerer/core_ext/kernel.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 printer= has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def printer=(printer)
          if printer.nil?
            @printer = printer_default
          elsif printer.is_a?(Logger)
            @printer = printer
    Severity: Minor
    Found in lib/puts_debuggerer.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 convert_options has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def convert_options(hash)
          Hash[hash.map { |key, value| OPTION_ALIASES[key] ? ( value == :t ?  [OPTION_ALIASES[key], true] : [OPTION_ALIASES[key], value] ) : [key, value]}]
        end
    Severity: Minor
    Found in lib/puts_debuggerer.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 __caller_source_line__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

      def __caller_source_line__(caller_depth=0, source_line_count=nil, source_file=nil, source_line_number=nil)
        source_line_number ||= __caller_line_number__(caller_depth+1)
        source_file ||= __caller_file__(caller_depth+1)
        source_line = ''
        if defined?(Pry) && source_file.include?('(pry)')
    Severity: Minor
    Found in lib/puts_debuggerer/core_ext/kernel.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