RnD-Soft/main_loop

View on GitHub

Showing 5 of 72 total issues

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

    def term
      unless @pid
        @terminating_at ||= Time.now
        logger.debug "Process[#{name}] alredy terminated. Skipped."
        return
Severity: Minor
Found in lib/main_loop/process_handler.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 term has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def term
      unless @thread
        @terminating_at ||= Time.now
        logger.debug "Thread[#{name}] alredy terminated. Skipped."
        return
Severity: Minor
Found in lib/main_loop/thread_handler.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 reap_children has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def reap_children
      results = []

      @dispatcher.pids.each do |pid|
        if (result = self.wait2(pid))
Severity: Minor
Found in lib/main_loop/loop.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 gets_nonblock has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def gets_nonblock
      while (ch = @read.read_nonblock(1))
        @buffer << ch
        next if ch != MainLoop::Bus::EOL

Severity: Minor
Found in lib/main_loop/bus.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 try_exit! has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def try_exit!
      synchronize do
        return unless handlers.all?(&:finished?)

        logger.info('All handlers finished exiting...')
Severity: Minor
Found in lib/main_loop/dispatcher.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