Showing 327 of 327 total issues
Method process_client
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process_client(client)
# Advertise this server into the thread
Thread.current[THREAD_LOCAL_KEY] = self
clean_thread_locals = options[:clean_thread_locals]
Method teardown
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def teardown
if @server && defined?(@control_tcp_port) && Puma.windows?
cli_pumactl 'stop'
elsif @server && @pid && !Puma.windows?
stop_server @pid, signal: :INT
- 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 after_teardown
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def after_teardown
return if skipped?
super
# Errno::EBADF raised on macOS
@ios_to_close.each do |io|
- 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 save
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def save(path, permission = nil)
contents = +"---\n"
@options.each do |k,v|
next unless ALLOWED_FIELDS.include? k
case 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 run_wrk_parse
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run_wrk_parse(cmd, log: false)
STDOUT.syswrite cmd.ljust 55
if @dly_app
cmd.sub! ' -H ', " -H 'Dly: #{@dly_app.round 4}' -H "
Method send_request
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
def send_request
uri = URI.parse @control_url
host = uri.host
File test_rack_handler.rb
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative "helper"
# Most tests check that ::Rack::Handler::Puma works by itself
# RackUp#test_bin runs Puma using the rackup bin file
module TestRackUp
Class TestResponseHeader
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class TestResponseHeader < Minitest::Test
parallelize_me!
# this file has limited response length, so 10kB works.
CLIENT_SYSREAD_LENGTH = 10_240
Class TestIntegrationSingle
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class TestIntegrationSingle < TestIntegration
parallelize_me! if ::Puma.mri?
def workers ; 0 ; end
Class TestRequestInvalid
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class TestRequestInvalid < Minitest::Test
# running parallel seems to take longer...
# parallelize_me! unless JRUBY_HEAD
GET_PREFIX = "GET / HTTP/1.1\r\nConnection: close\r\n"
Class Runner
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Runner
def initialize(launcher)
@launcher = launcher
@log_writer = launcher.log_writer
@events = launcher.events
Class Configuration
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Configuration
DEFAULTS = {
auto_trim_time: 30,
binds: ['tcp://0.0.0.0:9292'.freeze],
clean_thread_locals: false,
Method ssl_bind_str
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.ssl_bind_str(host, port, opts)
verify = opts.fetch(:verify_mode, 'none').to_s
tls_str =
if opts[:no_tlsv1_1] then '&no_tlsv1_1=true'
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
if @options[:fork_worker]
Signal.trap "SIGURG" do
fork_worker!
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 a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def initialize(argv, stdout=STDOUT, stderr=STDERR)
@state = nil
@quiet = false
@pidfile = nil
@pid = 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 call
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def call(env)
path = env['PATH_INFO']
script_name = env['SCRIPT_NAME']
http_host = env['HTTP_HOST']
server_name = env['SERVER_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"
Further reading
Method config
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def config(app, options = {})
require_relative '../../puma'
require_relative '../../puma/configuration'
require_relative '../../puma/log_writer'
require_relative '../../puma/launcher'
- 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_parse_proxy_protocol
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def try_to_parse_proxy_protocol
if @read_proxy
if @expect_proxy_proto == :v1
if @buffer.include? "\r\n"
if md = PROXY_PROTOCOL_V1_REGEX.match(@buffer)
- 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 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"