tlsfuzzer/tlslite-ng

View on GitHub

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.
Severity: Minor
Found in tlslite/tlsrecordlayer.py - About 55 mins to fix

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
Severity: Minor
Found in tlslite/messages.py - About 55 mins to fix

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:
Severity: Minor
Found in tlslite/messages.py - About 55 mins to fix

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.
Severity: Minor
Found in tlslite/handshakehashes.py - About 55 mins to fix

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
Severity: Minor
Found in tlslite/messages.py - About 55 mins to fix

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
Severity: Minor
Found in tlslite/tlsconnection.py - About 55 mins to fix

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
Severity: Minor
Found in tlslite/recordlayer.py - About 55 mins to fix

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,
Severity: Major
Found in tlslite/utils/brotlidecpy/decode.py - About 50 mins to fix

    Function _create_cert_msg has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def _create_cert_msg(self, peer, request_msg, valid_compression_algos,
    Severity: Major
    Found in tlslite/tlsrecordlayer.py - About 50 mins to fix

      Function _clientFinished has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def _clientFinished(self, premasterSecret, clientRandom, serverRandom,
      Severity: Major
      Found in tlslite/tlsconnection.py - About 50 mins to fix

        Function makeCertificateVerify has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def makeCertificateVerify(version, handshakeHashes, validSigAlgs,
        Severity: Major
        Found in tlslite/keyexchange.py - About 50 mins to fix

          Function _serverSRPKeyExchange has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def _serverSRPKeyExchange(self, clientHello, serverHello, verifierDB,
          Severity: Major
          Found in tlslite/tlsconnection.py - About 50 mins to fix

            Function create has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    def create(self, public_key, min_generation, generation, expiration,
            Severity: Minor
            Found in tlslite/extensions.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                              for result in self._sendMsg(alertMsg):
                                                  yield result
                                          except socket.error:
              Severity: Major
              Found in tlslite/tlsrecordlayer.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                            if subType == HandshakeType.hello_request:
                                                reneg = True
                                        else:
                Severity: Major
                Found in tlslite/tlsrecordlayer.py - About 45 mins to fix

                  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:
                  Severity: Major
                  Found in tlslite/checker.py - About 45 mins to fix

                    Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def __init__(self, elemLength, elemNum, lengthLength, fieldName, extType,
                    Severity: Minor
                    Found in tlslite/extensions.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                  for result in self._sendMsg(alertMsg):
                                                      yield result
                                                  continue
                      Severity: Major
                      Found in tlslite/tlsrecordlayer.py - About 45 mins to fix

                        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.\
                        Severity: Major
                        Found in tlslite/tlsrecordlayer.py - About 45 mins to fix

                          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 "
                          Severity: Major
                          Found in tlslite/tlsrecordlayer.py - About 45 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language