tlsfuzzer/tlslite-ng

View on GitHub

Showing 1,708 of 1,708 total issues

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

    def __init__(self, use_datetime=0,
Severity: Major
Found in tlslite/integration/xmlrpctransport.py - About 1 hr to fix

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

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

      Function _serverGetClientHello has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def _serverGetClientHello(self, settings, private_key, cert_chain,
      Severity: Major
      Found in tlslite/tlsconnection.py - About 1 hr to fix

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

            def __init__(self, cipherSuite, clientHello, serverHello, privateKey,
        Severity: Major
        Found in tlslite/keyexchange.py - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

                  if (psk and
                          PskKeyExchangeMode.psk_dhe_ke in psk_types.modes and
                          "psk_dhe_ke" in settings.psk_modes) or\
                          (psk is None and privateKey):
                      self.ecdhCurve = selected_group
          Severity: Major
          Found in tlslite/tlsconnection.py - About 1 hr to fix

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

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

              Function handshakeClientSRP has 8 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def handshakeClientSRP(self, username, password, session=None,
              Severity: Major
              Found in tlslite/tlsconnection.py - About 1 hr to fix

                Function calc_key has 8 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def calc_key(version, secret, cipher_suite, label, handshake_hashes=None,
                Severity: Major
                Found in tlslite/mathtls.py - About 1 hr to fix

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

                      def __init__(self):
                          """Create instance of CertificateStatusExtension."""
                          super(CertificateStatusExtension, self).__init__(
                              extType=ExtensionType.status_request)
                          self.status_type = None
                  Severity: Major
                  Found in tlslite/extensions.py and 1 other location - About 1 hr to fix
                  tlslite/extensions.py on lines 2015..2020

                  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 41.

                  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:
                      import brotli
                      compression_algo_impls["brotli_compress"] = brotli.compress
                      compression_algo_impls["brotli_decompress"] = brotli.decompress
                      compression_algo_impls["brotli_accepts_limit"] = False
                  Severity: Major
                  Found in tlslite/utils/compression.py and 1 other location - About 1 hr to fix
                  tlslite/utils/compression.py on lines 36..40

                  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 41.

                  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:
                      import zstandard
                      compression_algo_impls["zstd_compress"] = zstandard.compress
                      compression_algo_impls["zstd_decompress"] = zstandard.decompress
                      compression_algo_impls["zstd_accepts_limit"] = True
                  Severity: Major
                  Found in tlslite/utils/compression.py and 1 other location - About 1 hr to fix
                  tlslite/utils/compression.py on lines 23..27

                  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 41.

                  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

                          md5Bytes = MD5(masterSecret + bytearray([0x5c]*48) + \
                                           bytearray(imacMD5.digest()))
                  Severity: Major
                  Found in tlslite/handshakehashes.py and 1 other location - About 1 hr to fix
                  tlslite/handshakehashes.py on lines 92..93

                  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 41.

                  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 __init__(self):
                          """Create instance of class."""
                          super(PreSharedKeyExtension, self).__init__(
                              extType=ExtensionType.pre_shared_key)
                          self.identities = None
                  Severity: Major
                  Found in tlslite/extensions.py and 1 other location - About 1 hr to fix
                  tlslite/extensions.py on lines 1714..1719

                  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 41.

                  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 readable(self):
                          """Check if the protocol is ready for reading."""
                          result = self.wants_read_event()
                          return result if result is not None \
                              else self.sibling_class.readable(self)
                  Severity: Major
                  Found in tlslite/integration/tlsasynciodispatchermixin.py and 1 other location - About 1 hr to fix
                  tlslite/integration/tlsasynciodispatchermixin.py on lines 120..124

                  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 41.

                  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 writable(self):
                          """Check if the protocol is ready for writing."""
                          result = self.wants_write_event()
                          return result if result is not None \
                              else self.sibling_class.writable(self)
                  Severity: Major
                  Found in tlslite/integration/tlsasynciodispatchermixin.py and 1 other location - About 1 hr to fix
                  tlslite/integration/tlsasynciodispatchermixin.py on lines 114..118

                  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 41.

                  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

                          shaBytes = SHA1(masterSecret + bytearray([0x5c]*40) + \
                                           bytearray(imacSHA.digest()))
                  Severity: Major
                  Found in tlslite/handshakehashes.py and 1 other location - About 1 hr to fix
                  tlslite/handshakehashes.py on lines 90..91

                  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 41.

                  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 encrypt has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def encrypt(self, plaintext):
                          """Encrypt a single block of plaintext."""
                          if len(plaintext) != self.block_size:
                              raise ValueError('wrong block length, expected {0} got {1}'
                                               .format(self.block_size, len(plaintext)))
                  Severity: Minor
                  Found in tlslite/utils/rijndael.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 EMSA_PSS_verify has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def EMSA_PSS_verify(self, mHash, EM, emBits, hAlg, sLen=0):
                          """Verify signature in passed in encoded message
                  
                          This verifies the signature in encoded message
                  
                  
                  Severity: Minor
                  Found in tlslite/utils/rsakey.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 password_callback has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def password_callback(v, prompt1='Enter private key passphrase:',
                                             prompt2='Verify passphrase:'):
                      from getpass import getpass
                      while 1:
                          try:
                  Severity: Minor
                  Found in tlslite/utils/openssl_rsakey.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 _parseKeyHelper has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def _parseKeyHelper(key, private, public):
                      if private and not key.hasPrivateKey():
                          raise SyntaxError("Not a private key!")
                  
                      if public:
                  Severity: Minor
                  Found in tlslite/utils/keyfactory.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

                  Severity
                  Category
                  Status
                  Source
                  Language