lib/volt/server/forking_server.rb

Summary

Maintainability
A
3 hrs
Test Coverage

Method start_child has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    def start_child
      # Aquire the write lock, so we prevent anyone from using the child until
      # its setup or recreated.
      unless @drb_object
        # Get the id of the parent process, so we can wait for exit in the child
Severity: Minor
Found in lib/volt/server/forking_server.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 start_child has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def start_child
      # Aquire the write lock, so we prevent anyone from using the child until
      # its setup or recreated.
      unless @drb_object
        # Get the id of the parent process, so we can wait for exit in the child
Severity: Minor
Found in lib/volt/server/forking_server.rb - About 1 hr to fix

    Method call has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def call(env)
          @child_lock.with_read_lock do
            if @exiting
              [500, {}, 'Server Exiting']
            else
    Severity: Minor
    Found in lib/volt/server/forking_server.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

    There are no issues that match your filters.

    Category
    Status