tlsfuzzer/tlslite-ng

View on GitHub
tlslite/extensions.py

Summary

Maintainability
F
1 wk
Test Coverage
A
99%

File extensions.py has 1694 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright (c) 2014, 2015 Hubert Kario
#
# See the LICENSE file for legal information regarding use of this file.

""" Helper package for handling TLS extensions encountered in ClientHello
Severity: Major
Found in tlslite/extensions.py - About 4 days 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

      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

        Consider simplifying this complex logical expression.
        Open

                        if self.public_key == other.public_key and\
                           self.min_generation == other.min_generation and\
                           self.generation == other.generation and\
                           self.expiration == other.expiration and\
                           self.target_hash == other.target_hash and\
        Severity: Major
        Found in tlslite/extensions.py - About 40 mins to fix

          Consider simplifying this complex logical expression.
          Open

                      if hasattr(other, 'public_key') and\
                              hasattr(other, 'min_generation') and\
                              hasattr(other, 'generation') and\
                              hasattr(other, 'expiration') and\
                              hasattr(other, 'target_hash') and\
          Severity: Major
          Found in tlslite/extensions.py - About 40 mins to fix

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

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

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

                  def __init__(self, server=False, extType=None, encExt=False,
              Severity: Minor
              Found in tlslite/extensions.py - About 35 mins to fix

                Function create has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def create(self, hostname=None, hostNames=None, serverNames=None):
                        """
                        Initializes an instance with provided hostname, host names or
                        raw server names.
                
                
                Severity: Minor
                Found in tlslite/extensions.py - About 25 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

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

                        def create(self, public_key, min_generation, generation, expiration,
                                   target_hash, signature):
                            """
                            Initialise the TACK with data
                            """
                Severity: Major
                Found in tlslite/extensions.py and 1 other location - About 2 hrs to fix
                tlslite/messages.py on lines 1006..1015

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

                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

                    @property
                    def extData(self):
                        """
                        Return raw data encoding of the extension.
                
                
                Severity: Major
                Found in tlslite/extensions.py and 1 other location - About 2 hrs to fix
                tlslite/extensions.py on lines 532..546

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

                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

                    @property
                    def extData(self):
                        """
                        Return raw data encoding of the extension.
                
                
                Severity: Major
                Found in tlslite/extensions.py and 1 other location - About 2 hrs to fix
                tlslite/extensions.py on lines 468..482

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

                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

                    @property
                    def extData(self):
                        """
                        Return raw data encoding of the extension.
                
                
                Severity: Major
                Found in tlslite/extensions.py and 1 other location - About 2 hrs to fix
                tlslite/extensions.py on lines 601..612

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

                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

                    @property
                    def extData(self):
                        """Return raw data encoding of the extension.
                
                        :rtype: bytearray
                Severity: Major
                Found in tlslite/extensions.py and 1 other location - About 2 hrs to fix
                tlslite/extensions.py on lines 368..380

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

                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 parse(self, parser):
                        """Parse the extension from on the wire format
                
                        :param Parser p: parser with data
                        """
                Severity: Major
                Found in tlslite/extensions.py and 1 other location - About 1 hr to fix
                tlslite/extensions.py on lines 1813..1818

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

                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 parse(self, parser):
                        """Deserialise the extension from on the wire data."""
                        # the generic class allows for missing values, it's not allowed here
                        if not parser.getRemainingLength():
                            raise DecodeError("Empty extension payload")
                Severity: Major
                Found in tlslite/extensions.py and 1 other location - About 1 hr to fix
                tlslite/extensions.py on lines 998..1006

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

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

                    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

                class RenegotiationInfoExtension(VarBytesExtension):
                    """
                    Client and Server Hello secure renegotiation extension from RFC 5746
                
                    Should have an empty renegotiated_connection field in case of initial
                Severity: Minor
                Found in tlslite/extensions.py and 1 other location - About 50 mins to fix
                tlslite/extensions.py on lines 2096..2102

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

                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 parse(self, parser):
                        """Deserialize the object from bytearray."""
                        self.identity = parser.getVarBytes(2)
                        self.obfuscated_ticket_age = parser.get(4)
                        return self
                Severity: Minor
                Found in tlslite/extensions.py and 1 other location - About 50 mins to fix
                tlslite/extensions.py on lines 1772..1782

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

                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 parse(self, parser):
                        """
                        Parse the value from on the wire format.
                
                        :param Parser parser: data to be parsed as extension
                Severity: Minor
                Found in tlslite/extensions.py and 1 other location - About 50 mins to fix
                tlslite/extensions.py on lines 2004..2008

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

                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

                class CookieExtension(VarBytesExtension):
                    """Handling of the TLS 1.3 cookie extension."""
                
                    def __init__(self):
                        """Create instance."""
                Severity: Minor
                Found in tlslite/extensions.py and 1 other location - About 50 mins to fix
                tlslite/extensions.py on lines 1503..1517

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

                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

                class SignatureAlgorithmsExtension(_SigListExt):
                    """
                    Client side list of supported signature algorithms.
                
                    Should be used by server to select certificate and signing method for
                Severity: Minor
                Found in tlslite/extensions.py and 1 other location - About 40 mins to fix
                tlslite/extensions.py on lines 1434..1450

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

                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 the object."""
                        super(HRRKeyShareExtension, self).__init__(extType=ExtensionType.
                                                                   key_share,
                                                                   hrr=True)
                Severity: Minor
                Found in tlslite/extensions.py and 1 other location - About 40 mins to fix
                tlslite/extensions.py on lines 1896..1901

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

                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 the object."""
                        super(ServerKeyShareExtension, self).__init__(extType=ExtensionType.
                                                                      key_share,
                                                                      server=True)
                Severity: Minor
                Found in tlslite/extensions.py and 1 other location - About 40 mins to fix
                tlslite/extensions.py on lines 1945..1950

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

                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

                class SignatureAlgorithmsCertExtension(_SigListExt):
                    """
                    Client side list of supported signatures in certificates.
                
                    Should be used when the signatures supported in certificates and in TLS
                Severity: Minor
                Found in tlslite/extensions.py and 1 other location - About 40 mins to fix
                tlslite/extensions.py on lines 1415..1431

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

                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 5 locations. Consider refactoring.
                Open

                class PskKeyExchangeModesExtension(VarListExtension):
                    """Handling of the PSK Key Exchange Modes extension."""
                
                    def __init__(self):
                        """Create instance of class."""
                Severity: Major
                Found in tlslite/extensions.py and 4 other locations - About 35 mins to fix
                tlslite/extensions.py on lines 944..969
                tlslite/extensions.py on lines 1353..1368
                tlslite/extensions.py on lines 1371..1386
                tlslite/extensions.py on lines 2161..2168

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

                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 5 locations. Consider refactoring.
                Open

                class ClientCertTypeExtension(VarListExtension):
                    """
                    This class handles the (client variant of) Certificate Type extension
                
                    See RFC 6091.
                Severity: Major
                Found in tlslite/extensions.py and 4 other locations - About 35 mins to fix
                tlslite/extensions.py on lines 1353..1368
                tlslite/extensions.py on lines 1371..1386
                tlslite/extensions.py on lines 2085..2093
                tlslite/extensions.py on lines 2161..2168

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

                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 5 locations. Consider refactoring.
                Open

                class CompressedCertificateExtension(VarListExtension):
                    """Client and server compress certificate extension from RFC 8879"""
                
                    def __init__(self):
                        """Create instance of class."""
                Severity: Major
                Found in tlslite/extensions.py and 4 other locations - About 35 mins to fix
                tlslite/extensions.py on lines 944..969
                tlslite/extensions.py on lines 1353..1368
                tlslite/extensions.py on lines 1371..1386
                tlslite/extensions.py on lines 2085..2093

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

                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 5 locations. Consider refactoring.
                Open

                class ECPointFormatsExtension(VarListExtension):
                    """
                    Client side list of supported ECC point formats.
                
                    See RFC4492.
                Severity: Major
                Found in tlslite/extensions.py and 4 other locations - About 35 mins to fix
                tlslite/extensions.py on lines 944..969
                tlslite/extensions.py on lines 1353..1368
                tlslite/extensions.py on lines 2085..2093
                tlslite/extensions.py on lines 2161..2168

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

                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 5 locations. Consider refactoring.
                Open

                class SupportedGroupsExtension(VarListExtension):
                    """
                    Client side list of supported groups of (EC)DHE key exchage.
                
                    See RFC4492, RFC7027 and RFC-ietf-tls-negotiated-ff-dhe-10
                Severity: Major
                Found in tlslite/extensions.py and 4 other locations - About 35 mins to fix
                tlslite/extensions.py on lines 944..969
                tlslite/extensions.py on lines 1371..1386
                tlslite/extensions.py on lines 2085..2093
                tlslite/extensions.py on lines 2161..2168

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

                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

                Line too long (82 > 79 characters)
                Open

                            # don't require specific handlers and indicate option by mere presence
                Severity: Minor
                Found in tlslite/extensions.py by pep8

                Limit all lines to a maximum of 79 characters.

                There are still many devices around that are limited to 80 character
                lines; plus, limiting windows to 80 characters makes it possible to
                have several windows side-by-side.  The default wrapping on such
                devices looks ugly.  Therefore, please limit all lines to a maximum
                of 79 characters. For flowing long blocks of text (docstrings or
                comments), limiting the length to 72 characters is recommended.
                
                Reports error E501.

                There are no issues that match your filters.

                Category
                Status