Code Duplication    Length = 13-14 lines in 2 locations

ospd_openvas/preferencehandler.py 2 locations

@@ 465-478 (lines=14) @@
462
        else:
463
            return
464
465
        if target_options:
466
            alive_test_ports = target_options.get('alive_test_ports')
467
            # Alive test was speciefied as bit field.
468
            alive_test = target_options.get('alive_test')
469
            # Alive test was speciefied as individual methods.
470
            alive_test_methods = target_options.get('alive_test_methods')
471
            # <alive_test> takes precedence over <alive_test_methods>
472
            if alive_test is None and alive_test_methods:
473
                alive_test = alive_test_methods_to_bit_field(
474
                    icmp=target_options.get('icmp') == '1',
475
                    tcp_syn=target_options.get('tcp_syn') == '1',
476
                    tcp_ack=target_options.get('tcp_ack') == '1',
477
                    arp=target_options.get('arp') == '1',
478
                    consider_alive=target_options.get('consider_alive') == '1',
479
                )
480
481
        if alive_test is not None:
@@ 337-349 (lines=13) @@
334
        target_opt_prefs_list = {}
335
        alive_test = None
336
337
        if target_options:
338
            # Alive test speciefied as bit field.
339
            alive_test = target_options.get('alive_test')
340
            # Alive test speciefied as individual methods.
341
            alive_test_methods = target_options.get('alive_test_methods')
342
            # alive_test takes precedence over alive_test_methods
343
            if alive_test is None and alive_test_methods:
344
                alive_test = alive_test_methods_to_bit_field(
345
                    icmp=target_options.get('icmp') == '1',
346
                    tcp_syn=target_options.get('tcp_syn') == '1',
347
                    tcp_ack=target_options.get('tcp_ack') == '1',
348
                    arp=target_options.get('arp') == '1',
349
                    consider_alive=target_options.get('consider_alive') == '1',
350
                )
351
352
        if target_options and alive_test: