Showing 271 of 328 total issues
Avoid deeply nested control flow statements. Open
w.term unless w.term?
Avoid deeply nested control flow statements. Open
rescue EOFError
break
Avoid deeply nested control flow statements. Open
if in_phased_restart && workers_not_booted.positive? && w0 = worker_at(0)
w0.ping!(status)
@events.fire(:ping!, w0)
end
Avoid deeply nested control flow statements. Open
start_of_rest = if rest.start_with?(CHUNK_VALID_ENDING)
CHUNK_VALID_ENDING_SIZE
else # we have started a trailer section, which we do not support. skip it!
rest.index(CHUNK_VALID_ENDING*2) + CHUNK_VALID_ENDING_SIZE*2
end
Avoid deeply nested control flow statements. Open
if u = params['mode']
mode = Integer('0'+u)
end
Avoid deeply nested control flow statements. Open
next if (byte_size = part.bytesize).zero?
Avoid deeply nested control flow statements. Open
next if part.nil? || (byte_size = part.bytesize).zero?
Avoid deeply nested control flow statements. Open
if u = params['backlog']
backlog = Integer(u)
end
Avoid deeply nested control flow statements. Open
@worker_write << "#{PipeRequest::IDLE}#{Process.pid}\n" rescue nil
Avoid deeply nested control flow statements. Open
@worker_write << "#{Puma::Const::PipeRequest::FORK}#{pid}:#{idx}\n" rescue nil
Method wait_until_not_full
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def wait_until_not_full
with_mutex do
while true
return if @shutdown
- 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
Avoid deeply nested control flow statements. Open
if io_buffer.length > IO_BUFFER_LEN_MAX
fast_write_str socket, io_buffer.read_and_reset
end
Avoid deeply nested control flow statements. Open
next if part.bytesize.zero?
Method create_activated_fds
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def create_activated_fds(env_hash)
@log_writer.debug "ENV['LISTEN_FDS'] #{ENV['LISTEN_FDS'].inspect} env_hash['LISTEN_PID'] #{env_hash['LISTEN_PID'].inspect}"
return [] unless env_hash['LISTEN_FDS'] && env_hash['LISTEN_PID'].to_i == $$
env_hash['LISTEN_FDS'].to_i.times do |index|
sock = TCPServer.for_fd(socket_activation_fd(index))
- 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
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def start
require_relative 'cli'
run_args = []
- 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 closed_socket?
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def closed_socket?(socket)
skt = socket.to_io
return false unless skt.kind_of?(TCPSocket) && @precheck_closing
begin
- 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
Avoid deeply nested control flow statements. Open
next if part.bytesize.zero?
Method read_chunked_body
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def read_chunked_body
while true
begin
chunk = @io.read_nonblock(4096, @read_buffer)
rescue IO::WaitReadable
- 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
Avoid deeply nested control flow statements. Open
@buffer = nil if @buffer.empty?
Avoid deeply nested control flow statements. Open
if io_buffer.length > IO_BUFFER_LEN_MAX
fast_write_str socket, io_buffer.read_and_reset
end