Showing 270 of 327 total issues
Method reset
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def reset(fast_check=true)
@parser.reset
@io_buffer.reset
@read_header = true
@read_proxy = !!@expect_proxy_proto
- 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 try_to_finish
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def try_to_finish
if env[CONTENT_LENGTH] && above_http_content_limit(env[CONTENT_LENGTH].to_i)
@http_content_length_limit_exceeded = true
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 test_verify_client_cert_roundtrip
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def test_verify_client_cert_roundtrip(tls1_2 = nil)
cert_path = File.expand_path '../examples/puma/client-certs', __dir__
bind_port
config = <<~CONFIG
Method aggregated_results
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def aggregated_results(io)
is_github_actions = ENV['GITHUB_ACTIONS'] == 'true'
filtered_results = results.dup
if options[:verbose]
Method initialize
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(app, events = nil, options = {})
@app = app
@events = events || Events.new
@check, @notify = nil
Method call
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def call(env)
unless authenticate(env)
return rack_response(403, 'Invalid auth token', 'text/plain')
end
Method try_to_finish
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def try_to_finish
if env[CONTENT_LENGTH] && above_http_content_limit(env[CONTENT_LENGTH].to_i)
@http_content_length_limit_exceeded = true
end
Method str_early_hints
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def str_early_hints(headers)
eh_str = +""
headers.each_pair do |k, vs|
next if illegal_header_key?(k)
- 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 aggregated_results
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def aggregated_results(io)
is_github_actions = ENV['GITHUB_ACTIONS'] == 'true'
filtered_results = results.dup
if options[:verbose]
- 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 ci_test_rps
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def ci_test_rps
host = ENV['HOST']
port = ENV['PORT'].to_i
str = 'a' * 65_500
- 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 a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def oob_server(**options)
@request_count = 0
@oob_count = 0
in_oob = Mutex.new
@mutex = Mutex.new
- 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 call
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def call(env)
unless authenticate(env)
return rack_response(403, 'Invalid auth token', 'text/plain')
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 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 config
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def config(app, options = {})
require_relative '../../puma'
require_relative '../../puma/configuration'
require_relative '../../puma/log_writer'
require_relative '../../puma/launcher'
Method read_response_array
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def read_response_array(skts, resp_count: nil, body_only: nil)
results = Array.new skts.length
Thread.new do
until skts.compact.empty?
skts.each_with_index do |skt, idx|
Method setup_signals
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def setup_signals
if @options[:fork_worker]
Signal.trap "SIGURG" do
fork_worker!
end
Method initialize
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize
sleep 5 # wait for server to boot
@thread_loops = nil
@clients_per_thread = nil
Method req_env_post_parse
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def req_env_post_parse(env)
to_delete = nil
to_add = nil
env.each do |k,v|
- 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 close_clients
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def close_clients
closed = 0
@ios_to_close.each do |socket|
if socket && socket.to_io.is_a?(IO) && !socket.closed?
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 close_listeners
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def close_listeners
@listeners.each do |l, io|
begin
io.close unless io.closed?
uri = URI.parse l
- 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"