tomato42/tlsfuzzer

View on GitHub

Showing 302 of 302 total issues

Identical blocks of code found in 3 locations. Consider refactoring.
Open

if self.verbose and self._total_measurements:
status = [0, self._total_measurements, Event()]
kwargs = {}
kwargs['unit'] = ' signatures'
kwargs['prefix'] = 'decimal'
Severity: Major
Found in tlsfuzzer/extract.py and 2 other locations - About 5 hrs to fix
tlsfuzzer/extract.py on lines 1127..1136
tlsfuzzer/extract.py on lines 1407..1416

Cyclomatic complexity is too high in method _analyse_weight_pairs. (34)
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 by radon

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

    Cyclomatic complexity is too high in function main. (31)
    Open

    def main():
    """Process arguments and start analysis."""
    output = None
    ecdf_plot = True
    scatter_plot = True
    Severity: Minor
    Found in tlsfuzzer/analysis.py by radon

    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

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

    if bootstraping_of_size["trim_mean_45"][0] < 0:
    trim_mean_45 = "{0:.3e} (±{1:.2e}s)".format(
    bootstraping_of_size["trim_mean_45"][0],
    bootstraping_of_size["trim_mean_45"][1]
    )
    Severity: Major
    Found in tlsfuzzer/analysis.py and 1 other location - About 4 hrs to fix
    tlsfuzzer/analysis.py on lines 1872..1880

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

    if bootstraping_of_size["trim_mean_05"][0] < 0:
    trim_mean_05 = "{0:.3e} (±{1:.2e}s)".format(
    bootstraping_of_size["trim_mean_05"][0],
    bootstraping_of_size["trim_mean_05"][1]
    )
    Severity: Major
    Found in tlsfuzzer/analysis.py and 1 other location - About 4 hrs to fix
    tlsfuzzer/analysis.py on lines 1883..1891

    Cyclomatic complexity is too high in method process. (29)
    Open

    def process(self, state, msg):
    """
    :type state: `~ConnectionState`
    """
    assert msg.contentType == ContentType.handshake
    Severity: Minor
    Found in tlsfuzzer/expect.py by radon

    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

    Cyclomatic complexity is too high in method run. (27)
    Open

    def run(self):
    """Execute conversation"""
    node = self.conversation
    try:
    while node is not None:
    Severity: Minor
    Found in tlsfuzzer/runner.py by radon

    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

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

    def wilcoxon_test(self):
    """Cross-test all classes with the Wilcoxon signed-rank test"""
    if not self.run_wilcoxon_test:
    return None
    if self.verbose:
    Severity: Major
    Found in tlsfuzzer/analysis.py and 1 other location - About 4 hrs to fix
    tlsfuzzer/analysis.py on lines 502..514

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

    def rel_t_test(self):
    """Cross-test all classes using the t-test for dependent, paired
    samples."""
    if not self.run_t_test:
    return None
    Severity: Major
    Found in tlsfuzzer/analysis.py and 1 other location - About 4 hrs to fix
    tlsfuzzer/analysis.py on lines 484..495

    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

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

    if callable(handler):
    handler(state, ext)
    elif isinstance(handler, TLSExtension):
    if not handler == ext:
    raise AssertionError("Expected extension not "
    Severity: Major
    Found in tlsfuzzer/expect.py and 1 other location - About 3 hrs to fix
    tlsfuzzer/expect.py on lines 696..708

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

    if callable(handler):
    handler(state, ext)
    elif isinstance(handler, TLSExtension):
    if not handler == ext:
    raise AssertionError("Expected extension not "
    Severity: Major
    Found in tlsfuzzer/expect.py and 1 other location - About 3 hrs to fix
    tlsfuzzer/expect.py on lines 1839..1851

    Cyclomatic complexity is too high in method generate. (22)
    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 by radon

    Function help_msg has 91 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 3 hrs to fix
      Severity
      Category
      Status
      Source
      Language