tlsfuzzer/tlsfuzzer

View on GitHub

Showing 77 of 274 total issues

Function help_msg has 62 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def help_msg():
    """Print help message."""
    print("Usage: extract [-l logfile] [-c capture] [[-o output] ...]")
    print(" -l logfile     Filename of the timing log (required)")
    print(" -c capture     Packet capture of the test run")
Severity: Major
Found in tlsfuzzer/extract.py - About 2 hrs to fix

    Function _process_extensions has a Cognitive Complexity of 23 (exceeds 10 allowed). Consider refactoring.
    Open

        def _process_extensions(self, state, cln_hello, srv_hello):
            """Check if extensions are correct."""
            # extensions allowed in TLS 1.3 ServerHello and HelloRetryRequest
            # messages (as some need to be echoed by server in EncryptedExtensions
            # and some in Certificate)
    Severity: Minor
    Found in tlsfuzzer/expect.py - About 2 hrs 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 58 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def __init__(self, log=None, capture=None, output=None, ip_address=None,
                     port=None, raw_times=None, col_name=None,
                     write_csv='timing.csv', write_pkt_csv='raw_times_detail.csv',
                     measurements_csv="measurements.csv",
                     binary=None, endian='little', no_quickack=False, delay=None,
    Severity: Major
    Found in tlsfuzzer/extract.py - About 2 hrs to fix

      Function _split_data_to_pairwise has a Cognitive Complexity of 22 (exceeds 10 allowed). Consider refactoring.
      Open

          def _split_data_to_pairwise(self, name):
              data = self._read_hamming_weight_data(name)
              try:
                  pair_writers = dict()
      
      
      Severity: Minor
      Found in tlsfuzzer/analysis.py - About 2 hrs 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_rsa_keys has a Cognitive Complexity of 21 (exceeds 10 allowed). Consider refactoring.
      Open

          def process_rsa_keys(self):
              # list of values for the Hamming weight of d, p, q, dP, dQ, qInv
              values = []
              times = []
              max_len = 20
      Severity: Minor
      Found in tlsfuzzer/extract.py - About 2 hrs 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 skillings_mack_test has a Cognitive Complexity of 21 (exceeds 10 allowed). Consider refactoring.
      Open

      def skillings_mack_test(values, groups, blocks, duplicates=None, status=None):
          """Perform the Skillings-Mack rank sum test.
      
          Skillings-Mack test is a Friedman-like test for unbalanced incomplete
          block design data. The null hypothesis is that no group stochastically
      Severity: Minor
      Found in tlsfuzzer/utils/stats.py - About 2 hrs 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 _make_signature has a Cognitive Complexity of 20 (exceeds 10 allowed). Consider refactoring.
      Open

          def _make_signature(self, status):
              """Create signature for CertificateVerify message."""
              if self.private_key is None:
                  raise ValueError("Can't create a signature without "
                                   "private key!")
      Severity: Minor
      Found in tlsfuzzer/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 process has a Cognitive Complexity of 20 (exceeds 10 allowed). Consider refactoring.
      Open

          def process(self, state, msg):
              """
              :type state: `~ConnectionState`
              """
              assert msg.contentType == ContentType.handshake
      Severity: Minor
      Found in tlsfuzzer/expect.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 main has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def main():
          """Process arguments and start extraction."""
          logfile = None
          capture = None
          output = None
      Severity: Minor
      Found in tlsfuzzer/extract.py - About 1 hr to fix

        Function generate has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def generate(self):
                """Create a dict() with test cases, where keys are descriptions and
                values are the ciphertexts."""
                ret = {}
        
        
        Severity: Minor
        Found in tlsfuzzer/utils/rsa.py - About 1 hr to fix

          Function _summarise_chunk has a Cognitive Complexity of 19 (exceeds 10 allowed). Consider refactoring.
          Open

          def _summarise_chunk(args):
              global _groups
              groups = _groups
              global _values
              values = _values
          Severity: Minor
          Found in tlsfuzzer/utils/stats.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 generate has a Cognitive Complexity of 19 (exceeds 10 allowed). Consider refactoring.
          Open

              def generate(self):
                  """Create a dict() with test cases, where keys are descriptions and
                  values are the ciphertexts."""
                  ret = {}
          
          
          Severity: Minor
          Found in tlsfuzzer/utils/rsa.py - About 1 hr to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function _create_and_write_line has a Cognitive Complexity of 19 (exceeds 10 allowed). Consider refactoring.
          Open

              def _create_and_write_line(self):
                  """
                  Takes multiple possible values for each key value, selecting one
                  in random for each key and writes the created line into the
                  intermediate file.
          Severity: Minor
          Found in tlsfuzzer/extract.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 guess_response has a Cognitive Complexity of 18 (exceeds 10 allowed). Consider refactoring.
          Open

          def guess_response(content_type, data, ssl2=False):
              """Guess which kind of message is in the record layer payload"""
              if content_type == ContentType.change_cipher_spec:
                  if len(data) != 1:
                      return "ChangeCipherSpec(invalid size)"
          Severity: Minor
          Found in tlsfuzzer/runner.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 _generate_ciphertext_with_fuzz has a Cognitive Complexity of 18 (exceeds 10 allowed). Consider refactoring.
          Open

              def _generate_ciphertext_with_fuzz(
                      self, subs, padding_byte=None, pms=None):
                  while True:
                      if pms is None:
                          rand_pms = getRandomBytes(self.pms_len)
          Severity: Minor
          Found in tlsfuzzer/utils/rsa.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

          Method main has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static void main(String[] args) {
          
                  try {
                      // setup the socket address
                      InetSocketAddress address = new InetSocketAddress(4433);
          Severity: Minor
          Found in 3rd-party-scripts/SimpleHTTPSServer.java - About 1 hr to fix

            Function ecdsa_iter has a Cognitive Complexity of 17 (exceeds 10 allowed). Consider refactoring.
            Open

                def ecdsa_iter(self, return_type="k-size"):
                    """
                    Iterator. Iterator to use for signatures signed by ECDSA private key.
                    """
                    k_map_filename = join(self.output, "ecdsa-k-time-map.csv")
            Severity: Minor
            Found in tlsfuzzer/extract.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 _write_summary has a Cognitive Complexity of 16 (exceeds 10 allowed). Consider refactoring.
            Open

                def _write_summary(self, difference, p_vals, sign_p_vals, worst_pair,
                                   friedman_p, worst_pair_conf_int):
                    """Write the report.txt file and print summary."""
                    report_filename = join(self.output, "report.csv")
                    text_report_filename = join(self.output, "report.txt")
            Severity: Minor
            Found in tlsfuzzer/analysis.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 process has 28 lines of code (exceeds 25 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 1 hr to fix

              Function _write_individual_results has a Cognitive Complexity of 15 (exceeds 10 allowed). Consider refactoring.
              Open

                  def _write_individual_results(self):
                      """Write results to report.csv"""
                      if self.verbose:
                          start_time = time.time()
                          print("[i] Starting calculation of individual results")
              Severity: Minor
              Found in tlsfuzzer/analysis.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