Showing 324 of 1,708 total issues
Function _handle_keyupdate_request
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _handle_keyupdate_request(self, request):
"""Process the KeyUpdate request.
:type request: KeyUpdate
:param request: Recieved KeyUpdate message.
- 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
Function write
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def write(self):
"""
Serialise the object.
:rtype: bytearray
- 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
Function _write_tls12
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _write_tls12(self):
w = Writer()
if self.certificateType == CertificateType.x509:
chainLength = 0
if self._cert_chain:
- 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
Function digest
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def digest(self, digest=None):
"""
Calculate and return digest for the already consumed data.
Used for Finished and CertificateVerify messages.
- 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
Function _compress
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _compress(self, msg):
if not (
(self.compression_algo == CertificateCompressionAlgorithm.zlib) or
(self.compression_algo == CertificateCompressionAlgorithm.brotli
and compression_algo_impls["brotli_compress"]) or
- 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
Function request_post_handshake_auth
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def request_post_handshake_auth(self, settings=None):
"""
Request Post-handshake Authentication from client.
The PHA process is asynchronous, and client may send some data before
- 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
Function sendRecord
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def sendRecord(self, msg):
"""
Encrypt, MAC and send arbitrary message as-is through socket.
Note that if the message was not fragmented to below 2**14 bytes
- 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
Function decode_block_type
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def decode_block_type(max_block_type, trees, tree_type, block_types,
Function _create_cert_msg
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def _create_cert_msg(self, peer, request_msg, valid_compression_algos,
Function _clientFinished
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def _clientFinished(self, premasterSecret, clientRandom, serverRandom,
Function makeCertificateVerify
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def makeCertificateVerify(version, handshakeHashes, validSigAlgs,
Function _serverSRPKeyExchange
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def _serverSRPKeyExchange(self, clientHello, serverHello, verifierDB,
Function create
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def create(self, public_key, min_generation, generation, expiration,
Avoid deeply nested control flow statements. Open
for result in self._sendMsg(alertMsg):
yield result
except socket.error:
Avoid deeply nested control flow statements. Open
if subType == HandshakeType.hello_request:
reneg = True
else:
Avoid deeply nested control flow statements. Open
if chain.getFingerprint() != self.x509Fingerprint:
raise TLSFingerprintError(\
"X.509 fingerprint mismatch: %s, %s" % \
(chain.getFingerprint(), self.x509Fingerprint))
elif chain:
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, elemLength, elemNum, lengthLength, fieldName, extType,
Avoid deeply nested control flow statements. Open
for result in self._sendMsg(alertMsg):
yield result
continue
Avoid deeply nested control flow statements. Open
if len(heartbeat_message.padding) < 16:
# per RFC, silently ignore if the message
# is malformed
continue
heartbeat_response = heartbeat_message.\
Avoid deeply nested control flow statements. Open
if not self.heartbeat_can_receive:
for result in self._sendError(
AlertDescription.
unexpected_message,
"Received heartbeat_request to "