tlsfuzzer/tlslite-ng

View on GitHub

Showing 324 of 1,708 total issues

Function _clientResume has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def _clientResume(self, session, serverHello, clientRandom,
                      nextProto, settings):

        if session and ((session.sessionID and \
            serverHello.session_id == session.sessionID) or
Severity: Minor
Found in tlslite/tlsconnection.py - About 1 hr 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 _sockRecvAll has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def _sockRecvAll(self, length):
        """
        Read exactly the amount of bytes specified in L{length} from raw socket.

        :rtype: generator
Severity: Minor
Found in tlslite/recordlayer.py - About 1 hr 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 calcSSL2PendingStates has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def calcSSL2PendingStates(self, cipherSuite, masterSecret, clientRandom,
                              serverRandom, implementations):
        """
        Create the keys for encryption and decryption in SSLv2

Severity: Minor
Found in tlslite/recordlayer.py - About 1 hr 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 paramStrength has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def paramStrength(param):
    """
    Return level of security for DH, DSA and RSA parameters.

    Provide the approximate level of security for algorithms based on finite
Severity: Minor
Found in tlslite/mathtls.py - About 1 hr 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 __init__ has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def __init__(self, sock):
        sock = BufferedSocket(sock)
        self.sock = sock
        self._recordLayer = RecordLayer(sock)

Severity: Minor
Found in tlslite/tlsrecordlayer.py - About 1 hr to fix

    Function choose_compression_send_algo has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    def choose_compression_send_algo(version, extension, valid_algos):
        if not extension or not version or version < (3, 4):
            return None
    
        chosen_compression_algo = None
    Severity: Minor
    Found in tlslite/utils/compression.py - About 1 hr 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 verify has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def verify(self, sigBytes, bytes, padding='pkcs1', hashAlg=None,
                   saltLen=None):
            """Verify the passed-in bytes with the signature.
    
            This verifies a PKCS1 signature on the passed-in data.
    Severity: Minor
    Found in tlslite/utils/rsakey.py - About 1 hr 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 _createPrivateRSAKey has 10 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def _createPrivateRSAKey(n, e, d, p, q, dP, dQ, qInv, key_type,
    Severity: Major
    Found in tlslite/utils/keyfactory.py - About 1 hr to fix

      Function hash has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def hash(self, clientRandom, serverRandom):
              """
              Calculate hash of parameters to sign.
      
              :rtype: bytearray
      Severity: Minor
      Found in tlslite/messages.py - About 1 hr 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 create has 10 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def create(self, version, random, session_id, cipher_suites,
      Severity: Major
      Found in tlslite/messages.py - About 1 hr to fix

        Function handshakeClientCert has 10 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def handshakeClientCert(self, certChain=None, privateKey=None,
        Severity: Major
        Found in tlslite/tlsconnection.py - About 1 hr to fix

          Function _clientSendClientHello has 10 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def _clientSendClientHello(self, settings, session, srpUsername,
          Severity: Major
          Found in tlslite/tlsconnection.py - About 1 hr to fix

            Function parse has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                def parse(self, parser):
                    """
                    Deserialise the message from :py:class:`Parser`,
            
                    returns self
            Severity: Minor
            Found in tlslite/messages.py - About 1 hr 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 keyingMaterialExporter has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                def keyingMaterialExporter(self, label, length=20):
                    """Return keying material as described in RFC 5705
            
                    :type label: bytearray
                    :param label: label to be provided for the exporter
            Severity: Minor
            Found in tlslite/tlsconnection.py - About 1 hr 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 _serverAnonKeyExchange has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                def _serverAnonKeyExchange(self, serverHello, keyExchange, cipherSuite):
            
                    # Create ServerKeyExchange
                    serverKeyExchange = keyExchange.makeServerKeyExchange()
            
            
            Severity: Minor
            Found in tlslite/tlsconnection.py - About 1 hr 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 _handshakeClientAsync has 10 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def _handshakeClientAsync(self, srpParams=(), certParams=(), anonParams=(),
            Severity: Major
            Found in tlslite/tlsconnection.py - About 1 hr to fix

              Function parse has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                  def parse(self, p):
                      """Deserialise object from on the wire data."""
                      if self.ssl2:
                          self.client_version = (p.get(1), p.get(1))
                          cipherSpecsLength = p.get(2)
              Severity: Minor
              Found in tlslite/messages.py - About 1 hr 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 __init__ has 9 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def __init__(self, n=0, e=0, d=0, p=0, q=0, dP=0, dQ=0, qInv=0,
              Severity: Major
              Found in tlslite/utils/python_rsakey.py - About 1 hr to fix

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

                        def __init__(self, n=0, e=0, d=0, p=0, q=0, dP=0, dQ=0, qInv=0,
                Severity: Major
                Found in tlslite/utils/pycrypto_rsakey.py - About 1 hr to fix

                  Function _clientKeyExchange has 9 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def _clientKeyExchange(self, settings, cipherSuite,
                  Severity: Major
                  Found in tlslite/tlsconnection.py - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language