lib/gorgon_bunny/lib/gorgon_bunny/transport.rb
Class Transport
has 40 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Transport
#
# API
#
File transport.rb
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "socket"
require "thread"
require "monitor"
begin
Method write
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
def write(data)
begin
if @read_write_timeout
GorgonBunny::Timeout.timeout(@read_write_timeout, GorgonBunny::ClientTimeout) do
if open?
- 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_tls_context
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def initialize_tls_context(ctx)
ctx.cert = OpenSSL::X509::Certificate.new(@tls_certificate) if @tls_certificate
ctx.key = OpenSSL::PKey::RSA.new(@tls_key) if @tls_key
ctx.cert_store = if @tls_certificate_store
@tls_certificate_store
- 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"