Showing 252 of 252 total issues
File test_puma_server.rb
has 1017 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative "helper"
require "puma/events"
require "net/http"
require "nio"
require "ipaddr"
Class TestPumaServer
has 97 methods (exceeds 20 allowed). Consider refactoring. Open
class TestPumaServer < Minitest::Test
parallelize_me! unless JRUBY_HEAD
def setup
@host = "127.0.0.1"
Method parse
has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring. Open
def parse(binds, log_writer, log_msg = 'Listening')
binds.each do |str|
uri = URI.parse str
case uri.scheme
when "tcp"
- 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 65 (exceeds 5 allowed). Consider refactoring. Open
def run
@status = :run
output_header "cluster"
- 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
Class DSL
has 68 methods (exceeds 20 allowed). Consider refactoring. Open
class DSL
include ConfigDefault
# convenience method so logic can be used in CI
# @see ssl_bind
Method decode_chunk
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
def decode_chunk(chunk)
if @partial_part_left > 0
if @partial_part_left <= chunk.size
if @partial_part_left > 2
write_chunk(chunk[0..(@partial_part_left-3)]) # skip the \r\n
- 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 context
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
def context
ctx = MiniSSL::Context.new
if defined?(JRUBY_VERSION)
unless params['keystore']
- 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 hot_restart_does_not_drop_connections
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
def hot_restart_does_not_drop_connections(num_threads: 1, total_requests: 500)
skipped = true
skip_if :jruby, suffix: <<-MSG
- file descriptors are not preserved on exec on JRuby; connection reset errors are expected during restarts
MSG
- 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 49 (exceeds 5 allowed). Consider refactoring. Open
def run
title = "puma: cluster worker #{index}: #{master}"
title += " [#{@options[:tag]}]" if @options[:tag] && !@options[:tag].empty?
$0 = title
- 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
File test_config.rb
has 481 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative "helper"
require_relative "helpers/config_file"
require "puma/configuration"
require 'puma/log_writer'
Method handle_servers
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
def handle_servers
begin
check = @check
sockets = [check] + @binder.ios
pool = @thread_pool
- 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
File test_integration_cluster.rb
has 472 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative "helper"
require_relative "helpers/integration"
require "time"
File client.rb
has 438 lines of code (exceeds 250 allowed). Consider refactoring. Open
class IO
# We need to use this for a jruby work around on both 1.8 and 1.9.
# So this either creates the constant (on 1.8), or harmlessly
# reopens it (on 1.9).
module WaitReadable
Class TestIntegrationCluster
has 47 methods (exceeds 20 allowed). Consider refactoring. Open
class TestIntegrationCluster < TestIntegration
parallelize_me! if ::Puma.mri?
def workers ; 2 ; end
Method read_response
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
def read_response(connection, timeout = nil)
timeout ||= RESP_READ_TIMEOUT
content_length = nil
chunked = nil
response = ''.dup
- 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
File test_puma_server_ssl.rb
has 426 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative "helper"
if ::Puma::HAS_SSL
require "puma/minissl"
require "net/http"
File server.rb
has 418 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'stringio'
require 'puma/thread_pool'
require 'puma/const'
require 'puma/log_writer'
Class TestBinderParallel
has 43 methods (exceeds 20 allowed). Consider refactoring. Open
class TestBinderParallel < TestBinderBase
parallelize_me!
def test_synthesize_binds_from_activated_fds_no_sockets
binds = ['tcp://0.0.0.0:3000']
Method ssl_bind_str
has a Cognitive Complexity of 38 (exceeds 5 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'
- 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
File cluster.rb
has 401 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'puma/runner'
require 'puma/util'
require 'puma/plugin'
require 'puma/cluster/worker_handle'
require 'puma/cluster/worker'