tomato42/tlsfuzzer

View on GitHub

Showing 87 of 302 total issues

File analysis.py has 2474 lines of code (exceeds 500 allowed). Consider refactoring.
Open

#!/usr/bin/python
# -*- coding: utf-8 -*-
 
# Author: Jan Koscielniak, (c) 2020
# Author: Hubert Kario, (c) 2020
Severity: Major
Found in tlsfuzzer/analysis.py - About 6 days to fix

    File messages.py has 1855 lines of code (exceeds 500 allowed). Consider refactoring.
    Open

    # Author: Hubert Kario, (c) 2015
    # Released under Gnu GPL v2.0, see LICENSE file for details
     
    """Objects for generating TLS messages to send."""
     
     
    Severity: Major
    Found in tlsfuzzer/messages.py - About 4 days to fix

      File expect.py has 1729 lines of code (exceeds 500 allowed). Consider refactoring.
      Open

      # Author: Hubert Kario, (c) 2015
      # Released under Gnu GPL v2.0, see LICENSE file for details
       
      """Parsing and processing of received TLS messages"""
      from __future__ import print_function
      Severity: Major
      Found in tlsfuzzer/expect.py - About 3 days to fix

        File extract.py has 1508 lines of code (exceeds 500 allowed). Consider refactoring.
        Open

        # Author: Jan Koscielniak, (c) 2020
        # Released under Gnu GPL v2.0, see LICENSE file for details
         
        """Extraction and analysis of timing information from a packet capture."""
         
         
        Severity: Major
        Found in tlsfuzzer/extract.py - About 3 days to fix

          Function analyze_bit_sizes has a Cognitive Complexity of 70 (exceeds 10 allowed). Consider refactoring.
          Open

          def analyze_bit_sizes(self):
          """
          Analyses K bit-sizes and creates the plots and the test result files
          which are placed in an analysis_results directory in the output folder.
           
           
          Severity: Minor
          Found in tlsfuzzer/analysis.py - About 1 day to fix

          Function _write_individual_results has a Cognitive Complexity of 66 (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 day to fix

          Function main has a Cognitive Complexity of 63 (exceeds 10 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 day to fix

          Analysis has 62 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Analysis(object):
          """Analyse extracted timing information from csv file."""
           
          def __init__(self, output, draw_ecdf_plot=True, draw_scatter_plot=True,
          draw_conf_interval_plot=True, multithreaded_graph=False,
          Severity: Major
          Found in tlsfuzzer/analysis.py - About 1 day to fix

            Function run has a Cognitive Complexity of 57 (exceeds 10 allowed). Consider refactoring.
            Open

            def run(self):
            """Execute conversation"""
            node = self.conversation
            try:
            while node is not None:
            Severity: Minor
            Found in tlsfuzzer/runner.py - About 1 day to fix

            Function _parse_pcap has a Cognitive Complexity of 51 (exceeds 10 allowed). Consider refactoring.
            Open

            def _parse_pcap(self):
            """Process capture file."""
            with open(self.capture, 'rb') as pcap:
            progress = None
            try:
            Severity: Minor
            Found in tlsfuzzer/extract.py - About 7 hrs to fix

            Function generate has a Cognitive Complexity of 48 (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 6 hrs to fix

            Consider simplifying this complex logical expression.
            Open

            if (tcp_pkt.flags & dpkt.tcp.TH_SYN and
            tcp_pkt.dport == self.port and
            ip_pkt.dst == self.ip_address):
            # a SYN packet was found - new connection
            # (if a retransmission it won't be counted as at least
            Severity: Critical
            Found in tlsfuzzer/extract.py - About 6 hrs to fix

              Function _analyse_weight_pairs has a Cognitive Complexity of 44 (exceeds 10 allowed). Consider refactoring.
              Open

              def _analyse_weight_pairs(self, pairs):
              out_dir = self.output
              output_files = dict()
              if self.run_sign_test:
              output_files['sign_test'] = open(
              Severity: Minor
              Found in tlsfuzzer/analysis.py - About 5 hrs to fix

              Extract has 39 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class Extract:
              """Extract timing information from packet capture."""
               
              def __init__(self, log=None, capture=None, output=None, ip_address=None,
              port=None, raw_times=None, col_name=None,
              Severity: Minor
              Found in tlsfuzzer/extract.py - About 5 hrs to fix

                Function generate has a Cognitive Complexity of 39 (exceeds 10 allowed). Consider refactoring.
                Open

                def generate(self, status):
                """Create a Client Key Exchange message."""
                if self.version is None:
                self.version = status.version
                 
                 
                Severity: Minor
                Found in tlsfuzzer/messages.py - About 5 hrs to fix

                Function process has a Cognitive Complexity of 36 (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 4 hrs to fix

                Function process_measurements_and_create_csv_file has a Cognitive Complexity of 35 (exceeds 10 allowed). Consider refactoring.
                Open

                def process_measurements_and_create_csv_file(
                self, values_iter, comparing_value
                ):
                """
                Processing all the nonces and associated time measurements from the
                Severity: Minor
                Found in tlsfuzzer/extract.py - About 4 hrs to fix

                Function _write_pkts has a Cognitive Complexity of 33 (exceeds 10 allowed). Consider refactoring.
                Open

                def _write_pkts(self):
                for _, _, _, clnt_msgs, clnt_msgs_acks, srv_msgs, srv_msgs_acks, _, _, _ in self.pckt_times:
                if len(clnt_msgs) != len(clnt_msgs_acks): # pragma: no cover
                # no coverage; assert
                print(clnt_msgs)
                Severity: Minor
                Found in tlsfuzzer/extract.py - About 4 hrs to fix

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

                def process(self, state, msg):
                """Process the Server Key Exchange message"""
                assert msg.contentType == ContentType.handshake
                parser = Parser(msg.write())
                hs_type = parser.get(1)
                Severity: Minor
                Found in tlsfuzzer/expect.py - About 4 hrs to fix

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

                def main():
                """Process arguments and start analysis."""
                output = None
                ecdf_plot = True
                scatter_plot = True
                Severity: Minor
                Found in tlsfuzzer/analysis.py - About 3 hrs to fix
                Severity
                Category
                Status
                Source
                Language