tlsfuzzer/tlslite-ng

View on GitHub

Showing 1,708 of 1,708 total issues

Function _handshakeServerAsyncHelper has 13 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _handshakeServerAsyncHelper(self, verifierDB,
Severity: Major
Found in tlslite/tlsconnection.py - About 1 hr to fix

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

        def __init__(self, host, port=None, strict=None,
    Severity: Major
    Found in tlslite/integration/httptlsconnection.py - About 1 hr to fix

      Function addVarTupleSeq has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          def addVarTupleSeq(self, seq, length, lengthLength):
              """
              Add a variable length list of same-sized element tuples.
      
              Note that all tuples must have the same size.
      Severity: Minor
      Found in tlslite/utils/codec.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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

              @IV.setter
              def IV(self, iv):
                  if self._context is not None:
                      m2.cipher_ctx_free(self._context)
                  self._IV = iv
      Severity: Major
      Found in tlslite/utils/openssl_aes.py and 1 other location - About 1 hr to fix
      tlslite/utils/openssl_aes.py on lines 105..110

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 48.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

              @counter.setter
              def counter(self, ctr):
                  if self._context is not None:
                      m2.cipher_ctx_free(self._context)
                  self._IV = ctr
      Severity: Major
      Found in tlslite/utils/openssl_aes.py and 1 other location - About 1 hr to fix
      tlslite/utils/openssl_aes.py on lines 44..49

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 48.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Function _handshakeClientAsyncHelper has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def _handshakeClientAsyncHelper(self, srpParams, certParams, anonParams,
                                     session, settings, serverName, nextProtos,
                                     reqTack, alpn):
      
              self._handshakeStart(client=True)
      Severity: Minor
      Found in tlslite/tlsconnection.py - About 1 hr to fix

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            def _doHandshakeOp(self):
                try:
                    self.result = next(self.handshaker)
                except StopIteration:
                    self.handshaker = None
        Severity: Major
        Found in tlslite/integration/asyncstatemachine.py and 1 other location - About 1 hr to fix
        tlslite/integration/asyncstatemachine.py on lines 171..177

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 47.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                        try:
                            KeyExchange.verifyServerKeyExchange(serverKeyExchange,
                                                                publicKey,
                                                                clientRandom,
                                                                serverRandom,
        Severity: Major
        Found in tlslite/tlsconnection.py and 1 other location - About 1 hr to fix
        tlslite/tlsconnection.py on lines 4128..4137

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 47.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                try:
                    serverKeyExchange = keyExchange.makeServerKeyExchange(sigHash)
                except TLSUnknownPSKIdentity:
                    for result in self._sendError(
                            AlertDescription.unknown_psk_identity):
        Severity: Major
        Found in tlslite/tlsconnection.py and 1 other location - About 1 hr to fix
        tlslite/tlsconnection.py on lines 1818..1831

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 47.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            def _doCloseOp(self):
                try:
                    self.result = next(self.closer)
                except StopIteration:
                    self.closer = None
        Severity: Major
        Found in tlslite/integration/asyncstatemachine.py and 1 other location - About 1 hr to fix
        tlslite/integration/asyncstatemachine.py on lines 163..169

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 47.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Function _filterSuites has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def _filterSuites(suites, settings, version=None):
                if version is None:
                    version = settings.maxVersion
                macNames = settings.macNames
                cipherNames = settings.cipherNames
        Severity: Minor
        Found in tlslite/constants.py - About 1 hr to fix

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

              def __init__(self, key, mode, IV, implementation):
                  if len(key) not in (16, 24, 32):
                      raise AssertionError()
                  if mode not in [2, 6]:
                      raise AssertionError()
          Severity: Minor
          Found in tlslite/utils/aes.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 deprecated_params has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

          def deprecated_params(names, warn="Param name '{old_name}' is deprecated, "
                                            "please use '{new_name}'"):
              """Decorator to translate obsolete names and warn about their use.
          
              :param dict names: dictionary with pairs of new_name: old_name
          Severity: Minor
          Found in tlslite/utils/deprecations.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 _checkAssert has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

              def _checkAssert(self, maxActive=1):
                  #This checks that only one operation, at most, is
                  #active, and that self.result is set appropriately.
                  activeOps = 0
                  if self.handshaker:
          Severity: Minor
          Found in tlslite/integration/asyncstatemachine.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 a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

                  def __init__(self, key, msg=None, digestmod=None):
                      """
                      Initialise the HMAC and hash first portion of data.
          
                      msg: data to hash
          Severity: Minor
          Found in tlslite/utils/tlshmac.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 _sendFinished has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

              def _sendFinished(self, masterSecret, cipherSuite=None, nextProto=None,
                      settings=None, send_session_ticket=False, client_cert_chain=None):
                  if send_session_ticket:
                      for result in self._serverSendTickets(settings):
                          yield result
          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 _tls12_verify_SKE has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

              def _tls12_verify_SKE(serverKeyExchange, publicKey, clientRandom,
                                    serverRandom, validSigAlgs):
                  """Verify TLSv1.2 version of SKE."""
                  if (serverKeyExchange.hashAlg, serverKeyExchange.signAlg) not in \
                          validSigAlgs:
          Severity: Minor
          Found in tlslite/keyexchange.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 _parse_tls12 has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

              def _parse_tls12(self, p):
                  p.startLengthCheck(3)
                  if self.certificateType == CertificateType.x509:
                      chainLength = p.get(3)
                      index = 0
          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 _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

          Severity
          Category
          Status
          Source
          Language