Method accept
has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring. Open
def accept
@transcript = Transcript.new
key_schedule = nil # TTTLS13::KeySchedule
priv_key = nil # OpenSSL::PKey::$Object
hs_wcipher = nil # TTTLS13::Cryptograph::$Object
- 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 accept
has 167 lines of code (exceeds 25 allowed). Consider refactoring. Open
def accept
@transcript = Transcript.new
key_schedule = nil # TTTLS13::KeySchedule
priv_key = nil # OpenSSL::PKey::$Object
hs_wcipher = nil # TTTLS13::Cryptograph::$Object
File server.rb
has 438 lines of code (exceeds 250 allowed). Consider refactoring. Open
module TTTLS13
using Refinements
module ServerState
# initial value is 0, eof value is -1
Class Server
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class Server
include Logging
attr_reader :transcript
Method gen_certificate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def gen_certificate(crt, ch, chain = [], ocsp_response = nil)
exs = Message::Extensions.new
# status_request
exs << Message::Extension::OCSPResponse.new(ocsp_response) \
unless ocsp_response.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 initialize
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def initialize(socket, **settings)
@connection = Connection.new(socket, :server)
@settings = DEFAULT_SERVER_SETTINGS.merge(settings)
logger.level = @settings[:loglevel]
- 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 valid_settings?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def valid_settings?
mod = CipherSuite
defined = mod.constants.map { |c| mod.const_get(c) }
return false unless (@settings[:cipher_suites] - defined).empty?
- 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"