Showing 84 of 95 total issues
Method deserialize
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def self.deserialize(binary, cipher, buffered = '',
record_size_limit = DEFAULT_RECORD_SIZE_LIMIT)
raise Error::ErrorAlerts, :internal_error if binary.nil?
raise Error::ErrorAlerts, :decode_error if binary.length < 5
- 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 deserialize
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def self.deserialize(binary, msg_type)
raise Error::ErrorAlerts, :internal_error if binary.nil?
exs = Extensions.new
i = 0
- 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_new_client_hello
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def send_new_client_hello(ch1,
hrr,
extensions,
binder_key = nil,
ech_state = nil)
Method deserialize
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.deserialize(binary)
raise Error::ErrorAlerts, :internal_error if binary.nil?
raise Error::ErrorAlerts, :decode_error if binary.length < 39
raise Error::ErrorAlerts, :internal_error \
unless binary[0] == HandshakeType::CLIENT_HELLO
Method deserialize
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.deserialize(binary)
raise Error::ErrorAlerts, :internal_error if binary.nil?
return nil if binary.length < 2
pskids_len = Convert.bin2i(binary.slice(0, 2))
Method deserialize
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.deserialize(binary)
raise Error::ErrorAlerts, :internal_error if binary.nil?
raise Error::ErrorAlerts, :decode_error if binary.length < 39
raise Error::ErrorAlerts, :internal_error \
unless binary[0] == HandshakeType::SERVER_HELLO
Method offer_ech
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.offer_ech(inner, ech_config, hpke_cipher_suite_selector)
return [new_greased_ch(inner, new_grease_ech), nil, nil] \
if ech_config.nil? ||
!SUPPORTED_ECHCONFIG_VERSIONS.include?(ech_config.version)
Method obj2html
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def obj2html(obj)
if obj.is_a?(OpenSSL::X509::Certificate)
obj.to_pem.gsub("\n", '<br>')
elsif obj.is_a?(Numeric) ||
obj.is_a?(TrueClass) || obj.is_a?(FalseClass)
Method deserialize
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.deserialize(binary, cipher, buffered = '',
record_size_limit = DEFAULT_RECORD_SIZE_LIMIT)
raise Error::ErrorAlerts, :internal_error if binary.nil?
raise Error::ErrorAlerts, :decode_error if binary.length < 5
Method sign_grease_psk_binder
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def sign_grease_psk_binder(ch1: nil,
hrr: nil,
ch_outer:,
inner_psk:,
binder_key:)
Method recv_message
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def recv_message(receivable_ccs:, cipher:)
return @message_queue.shift unless @message_queue.empty?
messages = nil
orig_msgs = []
Method gen_ch_extensions
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def gen_ch_extensions
exs = Message::Extensions.new
# server_name
exs << Message::Extension::ServerName.new(@hostname)
- 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 deserialize
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def self.deserialize(binary)
raise Error::ErrorAlerts, :internal_error if binary.nil?
raise Error::ErrorAlerts, :decode_error if binary.length < 5
raise Error::ErrorAlerts, :internal_error \
unless binary[0] == HandshakeType::COMPRESSED_CERTIFICATE
- 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 deserialize
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def self.deserialize(binary)
raise Error::ErrorAlerts, :internal_error if binary.nil?
return nil if binary.length < 2
- 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 check_invalid_certificate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def check_invalid_certificate(ct, ch)
return :illegal_parameter unless ct.appearable_extensions?
return :unsupported_extension \
unless ct.certificate_list.map(&:extensions)
- 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 encrypted_ech_config
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.encrypted_ech_config(ech_config, hpke_cipher_suite_selector)
public_name = ech_config.echconfig_contents.public_name
key_config = ech_config.echconfig_contents.key_config
public_key = key_config.public_key.opaque
kem_id = key_config&.kem_id&.uint16
Method deserialize
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.deserialize(binary)
raise Error::ErrorAlerts, :internal_error if binary.nil?
raise Error::ErrorAlerts, :decode_error if binary.length < 13
raise Error::ErrorAlerts, :internal_error \
unless binary[0] == HandshakeType::NEW_SESSION_TICKET
Method verified_certificate_verify?
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.verified_certificate_verify?(public_key:, signature_scheme:,
signature:, context:, hash:)
content = "\x20" * 64 + context + "\x00" + hash
# RSA signatures MUST use an RSASSA-PSS algorithm, regardless of whether
Method sign_certificate_verify
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.sign_certificate_verify(key:, signature_scheme:, context:, hash:)
content = "\x20" * 64 + context + "\x00" + hash
# RSA signatures MUST use an RSASSA-PSS algorithm, regardless of whether
# RSASSA-PKCS1-v1_5 algorithms appear in "signature_algorithms".
Method deserialize
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.deserialize(binary)
raise Error::ErrorAlerts, :internal_error if binary.nil?
raise Error::ErrorAlerts, :decode_error if binary.length < 5
raise Error::ErrorAlerts, :internal_error \
unless binary[0] == HandshakeType::COMPRESSED_CERTIFICATE