Showing 327 of 327 total issues
Class TestPumaControlCli
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class TestPumaControlCli < TestConfigFileBase
include SSLHelper
def setup
# use a pipe to get info across thread boundary
Method send_request
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def send_request
uri = URI.parse @control_url
# create server object by scheme
server =
- 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_signal
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def send_signal
unless @pid
raise 'Neither pid nor control url available'
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 handle_request
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
def handle_request(client, requests)
env = client.env
io_buffer = client.io_buffer
socket = client.io # io may be a MiniSSL::Socket
app_body = nil
Method str_headers
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
def str_headers(env, status, headers, res_body, io_buffer, force_keep_alive)
line_ending = LINE_END
colon = COLON
File bench_base.rb
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'optparse'
module TestPuma
HOST4 = ENV.fetch('PUMA_TEST_HOST4', '127.0.0.1')
File test_pumactl.rb
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative "helper"
require_relative "helpers/config_file"
require_relative "helpers/ssl"
require 'pathname'
Class TestCLI
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class TestCLI < Minitest::Test
include SSLHelper if ::Puma::HAS_SSL
include TmpPath
include TestPuma::PumaSocket
Method initialize
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(argv, stdout=STDOUT, stderr=STDERR)
@state = nil
@quiet = false
@pidfile = nil
@pid = nil
Method select_loop
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def select_loop
close_selector = true
begin
until @input.closed? && @input.empty?
# Wakeup any registered object that receives incoming data.
- 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_ssl.rb
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative 'helper'
require_relative "helpers/integration"
if ::Puma::HAS_SSL # don't load any files if no ssl support
require "net/http"
File test_thread_pool.rb
has 271 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative "helper"
require "puma/thread_pool"
class TestThreadPool < Minitest::Test
File thread_pool.rb
has 271 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'thread'
require_relative 'io_buffer'
module Puma
Class TestIntegration
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class TestIntegration < Minitest::Test
include TmpPath
HOST = "127.0.0.1"
TOKEN = "xxyyzz"
RESP_READ_LEN = 65_536
File puma_socket.rb
has 270 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'socket'
require_relative '../test_puma'
require_relative 'response'
module TestPuma
Method context
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
def context
ctx = MiniSSL::Context.new
if defined?(JRUBY_VERSION)
unless params['keystore']
Method start
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def start(launcher)
path = File.join("tmp", "restart.txt")
orig = 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 shutdown_requests
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def shutdown_requests(s1_complete: true, s1_response: nil, post: false, s2_response: nil, **options)
mutex = Mutex.new
app_finished = ConditionVariable.new
server_run(**options) { |env|
path = env['REQUEST_PATH']
- 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 TestThreadPool
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class TestThreadPool < Minitest::Test
def teardown
@pool.shutdown(1) if defined?(@pool)
end
Class Binder
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Binder
include Puma::Const
RACK_VERSION = [1,6].freeze