Code Duplication    Length = 13-14 lines in 2 locations

ospd_openvas/preferencehandler.py 2 locations

@@ 469-482 (lines=14) @@
466
        else:
467
            return
468
469
        if target_options:
470
            alive_test_ports = target_options.get('alive_test_ports')
471
            # Alive test was speciefied as bit field.
472
            alive_test = target_options.get('alive_test')
473
            # Alive test was speciefied as individual methods.
474
            alive_test_methods = target_options.get('alive_test_methods')
475
            # <alive_test> takes precedence over <alive_test_methods>
476
            if alive_test is None and alive_test_methods:
477
                alive_test = alive_test_methods_to_bit_field(
478
                    icmp=target_options.get('icmp') == '1',
479
                    tcp_syn=target_options.get('tcp_syn') == '1',
480
                    tcp_ack=target_options.get('tcp_ack') == '1',
481
                    arp=target_options.get('arp') == '1',
482
                    consider_alive=target_options.get('consider_alive') == '1',
483
                )
484
485
        if alive_test is not None:
@@ 331-343 (lines=13) @@
328
        target_opt_prefs_list = []
329
        alive_test = None
330
331
        if target_options:
332
            # Alive test speciefied as bit field.
333
            alive_test = target_options.get('alive_test')
334
            # Alive test speciefied as individual methods.
335
            alive_test_methods = target_options.get('alive_test_methods')
336
            # alive_test takes precedence over alive_test_methods
337
            if alive_test is None and alive_test_methods:
338
                alive_test = alive_test_methods_to_bit_field(
339
                    icmp=target_options.get('icmp') == '1',
340
                    tcp_syn=target_options.get('tcp_syn') == '1',
341
                    tcp_ack=target_options.get('tcp_ack') == '1',
342
                    arp=target_options.get('arp') == '1',
343
                    consider_alive=target_options.get('consider_alive') == '1',
344
                )
345
346
        if target_options and alive_test: