Showing 270 of 327 total issues
Method test_ssl_run_with_curl_client
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def test_ssl_run_with_curl_client
skip_if :windows; require 'stringio'
app = lambda { |_| [200, { 'Content-Type' => 'text/plain' }, ["HELLO", ' ', "THERE"]] }
opts = {max_threads: 1}
Method send_signal
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def send_signal
unless @pid
raise 'Neither pid nor control url available'
end
Method usr1_all_respond
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def usr1_all_respond(unix: false, config: '')
cli_server "-w #{workers} -t 0:5 -q test/rackup/sleep_pid.ru #{config}", unix: unix
threads = []
replies = []
mutex = Mutex.new
Method wait_workers
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def wait_workers
# Reap all children, known workers or otherwise.
# If puma has PID 1, as it's common in containerized environments,
# then it's responsible for reaping orphaned processes, so we must reap
# all our dead children, regardless of whether they are workers we spawned
Method assert_ssl_client_error_match
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def assert_ssl_client_error_match(error, subject: nil, context: CTX, &blk)
port = 0
app = lambda { |env| [200, {}, [env['rack.url_scheme']]] }
Method shutdown
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def shutdown(timeout=-1)
threads = with_mutex do
@shutdown = true
@trim_requested = @spawned
@not_empty.broadcast
Method test_tls_v1_rejection
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def test_tls_v1_rejection
start_server { |ctx| ctx.no_tlsv1 = true }
assert_raises(OpenSSL::SSL::SSLError) do
send_http_read_resp_body ctx: new_ctx { |c|
- 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 internal_write
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def internal_write(str)
LOG_QUEUE << str
while (w_str = LOG_QUEUE.pop(true)) do
begin
@stdout.is_a?(IO) and @stdout.wait_writable(1)
- 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 test_tls_v1_1_rejection
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def test_tls_v1_1_rejection
start_server { |ctx| ctx.no_tlsv1_1 = true }
assert_raises(OpenSSL::SSL::SSLError) do
send_http_read_response ctx: new_ctx { |c|
- 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 send_http_read_all
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def send_http_read_all(req = GET_11, host: nil, port: nil, path: nil, ctx: nil,
session: nil, len: nil, timeout: nil)
skt = send_http req, host: host, port: port, path: path, ctx: ctx, session: session
read = String.new # rubocop: disable Performance/UnfreezeString
counter = 0
- 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 fast_write_str
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def fast_write_str(socket, str)
n = 0
byte_size = str.bytesize
while n < byte_size
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
Method remap
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def remap(map)
@mapping = map.map { |location, app|
if location =~ %r{\Ahttps?://(.*?)(/.*)}
host, location = $1, $2
else
- 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 a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def initialize(app, events = nil, options = {})
@app = app
@events = events || Events.new
@check, @notify = nil
- 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 internal_write
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def internal_write(str)
LOG_QUEUE << str
while (w_str = LOG_QUEUE.pop(true)) do
begin
@ioerr.is_a?(IO) and @ioerr.wait_writable(1)
- 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 oob_server
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def oob_server(**options)
@request_count = 0
@oob_count = 0
in_oob = Mutex.new
@mutex = Mutex.new
Method test_ssl_run
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def test_ssl_run
config = <<~RUBY
if ::Puma.jruby?
keystore = '#{File.expand_path '../examples/puma/keystore.jks', __dir__}'
keystore_pass = 'jruby_puma'
Method reset
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def reset(fast_check=true)
@parser.reset
@io_buffer.reset
@read_header = true
@read_proxy = !!@expect_proxy_proto
Method read_body
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def read_body
if @chunked_body
return read_chunked_body
end
Method initialize
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(name, options = {}, &block)
@not_empty = ConditionVariable.new
@not_full = ConditionVariable.new
@mutex = Mutex.new
Method test_control_clustered
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def test_control_clustered
skip_unless :fork
skip_unless :unix
url = "unix://#{@tmp_path}"