tlsfuzzer/tlsfuzzer

View on GitHub

Showing 77 of 274 total issues

Avoid deeply nested control flow statements.
Open

                        if float(row[1]) > float(row[0]):
                            passed += 1
                        total += 1
Severity: Major
Found in tlsfuzzer/analysis.py - About 45 mins to fix

    Function uniqueness_check has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring.
    Open

    def uniqueness_check(values, count):
        """
        Check if values in the lists in the dictionary are unique.
    
        Also check if all the arrays have the length of :py:attr:`count`.
    Severity: Minor
    Found in tlsfuzzer/helpers.py - About 45 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

    Avoid deeply nested control flow statements.
    Open

                        if len(row) != 3:
                            raise ValueError("File does not have correct format")
    
    
    Severity: Major
    Found in tlsfuzzer/combine.py - About 45 mins to fix

      Function diff_ecdf_plot has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.
      Open

          def diff_ecdf_plot(self):
              """Generate ECDF plot of differences between test classes."""
              if not self.draw_ecdf_plot:
                  return
              if self.verbose:
      Severity: Minor
      Found in tlsfuzzer/analysis.py - About 35 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 _read_private_key has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.
      Open

          def _read_private_key(self, file):
              lines = []
              while True:
                  line = file.readline()
                  # empty line still has '\n', only EOF is an empty string
      Severity: Minor
      Found in tlsfuzzer/extract.py - About 35 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

      Avoid too many return statements within this function.
      Open

                  return "Handshake(invalid size)"
      Severity: Major
      Found in tlsfuzzer/runner.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                    return "Handshake({0})".format(HandshakeType.toStr(data[0]))
        Severity: Major
        Found in tlsfuzzer/runner.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return "ApplicationData(len={0})".format(len(data))
          Severity: Major
          Found in tlsfuzzer/runner.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                            return "Handshake(server_hello, hello_retry_request)"
            Severity: Major
            Found in tlsfuzzer/runner.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return ("Message(content_type={0}, first_byte={1}, "
              Severity: Major
              Found in tlsfuzzer/runner.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            return "Handshake({0})".format(SSL2HandshakeType.toStr(data[0]))
                Severity: Major
                Found in tlsfuzzer/runner.py - About 30 mins to fix

                  Function conf_interval_plot has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.
                  Open

                      def conf_interval_plot(self):
                          """Generate the confidence inteval for differences between samples."""
                          if not self.draw_conf_interval_plot:
                              return
                          if self.verbose:
                  Severity: Minor
                  Found in tlsfuzzer/analysis.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

                  Function process has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.
                  Open

                      def process(self, state, msg):
                          """
                          Process the message and update state accordingly
                  
                          :type state: ConnectionState
                  Severity: Minor
                  Found in tlsfuzzer/expect.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

                  Function post_send has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.
                  Open

                      def post_send(self, status):
                          """Generate new encryption keys for connection."""
                          # in TLS 1.3 it's a fake message, doesn't cause calculation of new keys
                          if status.version >= (3, 4) or self.fake:
                              return
                  Severity: Minor
                  Found in tlsfuzzer/messages.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

                  Function main has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.
                  Open

                  def main():
                      input_filelist = None
                      output = None
                      long_format = False
                  
                  
                  Severity: Minor
                  Found in tlsfuzzer/combine.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

                  Function _bit_size_come_to_verdict has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.
                  Open

                      def _bit_size_come_to_verdict(self, analysis_ret_val,
                                                    skillings_mack_pvalue):
                          """Comes to a verdict if implementation is vulnerable"""
                          explanation = None
                          difference = 1
                  Severity: Minor
                  Found in tlsfuzzer/analysis.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

                  Function _read_bit_size_measurement_file has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.
                  Open

                      def _read_bit_size_measurement_file(self, status=None):
                          """Returns an iterator with the data from the measurements file."""
                          with open(join(self.output, self.measurements_filename), 'r') as in_fp:
                              if status:
                                  in_fp.seek(0, 2)
                  Severity: Minor
                  Found in tlsfuzzer/analysis.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

                  Severity
                  Category
                  Status
                  Source
                  Language