thomis/eventhub-processor2

View on GitHub

Showing 5 of 296 total issues

Method main_event_loop has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def main_event_loop
      Celluloid.boot
      setup_signal_handler
      start_supervisor

Severity: Minor
Found in lib/eventhub/processor2.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 default_configuration has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def default_configuration
      {
        server: {
          user: "guest",
          password: "guest",
Severity: Minor
Found in lib/eventhub/configuration.rb - About 1 hr to fix

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

        def set(arg, value, overwrite = true)
          *key_path, last = arg.is_a?(String) ? arg.split(".") : arg
          if overwrite
            key_path.inject(self) { |h, key| h.key?(key) ? h[key] : h[key] = {} } [last] = value
          else
    Severity: Minor
    Found in lib/eventhub/hash_extensions.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 load_more! has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def load_more!(args = {})
          return unless args[:pattern]
    
          Dir.glob(args[:pattern]).sort.each do |name|
            next if File.directory?(name)
    Severity: Minor
    Found in lib/eventhub/configuration.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 publish has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def publish(args = {})
          # keep connection once established
          unless @connection
            @connection = create_bunny_connection
            @connection.start
    Severity: Minor
    Found in lib/eventhub/actor_publisher.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