Class Launcher
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
class Launcher
autoload :BundlePruner, 'puma/launcher/bundle_pruner'
# Returns an instance of Launcher
#
File launcher.rb
has 331 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative 'log_writer'
require_relative 'events'
require_relative 'detect'
require_relative 'cluster'
require_relative 'single'
Method setup_signals
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def setup_signals
begin
Signal.trap "SIGUSR2" do
restart
end
Method setup_signals
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def setup_signals
begin
Signal.trap "SIGUSR2" do
restart
end
- Read upRead up
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 initialize
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(conf, launcher_args={})
@runner = nil
@log_writer = launcher_args[:log_writer] || LogWriter::DEFAULT
@events = launcher_args[:events] || Events.new
@argv = launcher_args[:argv] || []
Method initialize
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def initialize(conf, launcher_args={})
@runner = nil
@log_writer = launcher_args[:log_writer] || LogWriter::DEFAULT
@events = launcher_args[:events] || Events.new
@argv = launcher_args[:argv] || []
- Read upRead up
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 generate_restart_data
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def generate_restart_data
if dir = @options[:directory]
@restart_dir = dir
elsif Puma.windows?
- Read upRead up
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 thread_status
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def thread_status
Thread.list.each do |thread|
name = "Thread: TID-#{thread.object_id.to_s(36)}"
name += " #{thread['label']}" if thread['label']
name += " #{thread.name}" if thread.respond_to?(:name) && thread.name
- Read upRead up
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"