Showing 7 of 7 total issues
Method start_signal_loop
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def start_signal_loop
last_check = Time.now
begin
loop do
@master.reap_all_workers
- 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 set_pid_path
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def set_pid_path(new_pid_path, new_pid)
if new_pid_path
if read_pid = read_path_pid(new_pid_path)
return new_pid_path if @pid_path && new_pid_path == @pid_path && read_pid == @pid
raise ArgumentError, "#{$$} Already running on PID:#{read_pid} (or #{new_pid_path} is stale)"
- 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 start_signal_loop
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def start_signal_loop
last_check = Time.now
begin
loop do
@master.reap_all_workers
Method reap_all_workers
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def reap_all_workers
begin
loop do
worker_pid, status = Process.waitpid2(-1, Process::WNOHANG)
break unless worker_pid
- 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 run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def run(ready_write = nil)
$stdin.reopen("/dev/null")
set_stdout_path(@options[:stdout_path])
set_stderr_path(@options[:stderr_path])
- 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 sleep_master
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def sleep_master
begin
maximum_sleep = @master.timeout > 1 ? 1 : @master.timeout / 2
ready = IO.select([@read_pipe], nil, nil, maximum_sleep) or return
ready.first && ready.first.first or return
- 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 murder_lazy_workers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def murder_lazy_workers
@workers.dup.each_pair do |worker_pid, worker|
stat = worker.tmp.stat
# skip workers that disable fchmod or have never fchmod-ed
next if stat.mode == 0100600
- 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"