code-mancers/invoker

View on GitHub

Showing 9 of 9 total issues

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

    class Config
      PORT_REGEX = /\$PORT/

      attr_accessor :processes, :power_config
      attr_reader :filename
Severity: Minor
Found in lib/invoker/parsers/config.rb - About 2 hrs to fix

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

            def attributes
              message_attribute_keys = message_attributes || []
              message_attribute_keys.reduce({}) do |mem, obj|
                value = send(obj)
                if value.is_a?(Array)
    Severity: Minor
    Found in lib/invoker/ipc/message.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 make_pconfig has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

          def make_pconfig(section)
            pconfig = {
              label: section["label"] || section.key,
              dir: expand_directory(section["directory"]),
              cmd: section["command"]
    Severity: Minor
    Found in lib/invoker/parsers/config.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_ports has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

          def find_ports
            STARTING_PORT.upto(STARTING_PORT + 100) do |port|
              break if @ports.size > 3
              if check_if_port_is_open(port)
                @ports << port
    Severity: Minor
    Found in lib/invoker/power/port_finder.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 list has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def list
          if options[:wait]
            Signal.trap("INT") { exit(0) }
            loop do
              puts "\e[H\e[2J"
    Severity: Minor
    Found in lib/invoker/cli.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 distro_installer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

            def self.distro_installer(tld)
              if distro.start_with? "Arch Linux", "Manjaro Linux"
                require "invoker/power/setup/distro/arch"
                Arch.new(tld)
              elsif distro.start_with? "Debian"
    Severity: Minor
    Found in lib/invoker/power/setup/distro/base.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 headers_received has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

          def headers_received(headers)
            if @session
              return
            end
            @session = UUID.generate()
    Severity: Minor
    Found in lib/invoker/power/balancer.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 select_backend_config has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

          def select_backend_config(complete_path)
            possible_matches = extract_host_from_domain(complete_path)
            exact_match = nil
            possible_matches.each do |match|
              if match
    Severity: Minor
    Found in lib/invoker/power/url_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 receive_line has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def receive_line(line)
          tail_watchers = Invoker.tail_watchers[@command_label]
          color_line = "#{@command_label.colorize(color)} : #{line}"
          plain_line = "#{@command_label} : #{line}"
          if Invoker.nocolors?
    Severity: Minor
    Found in lib/invoker/command_worker.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