Code Duplication    Length = 13-14 lines in 2 locations

ospd_openvas/preferencehandler.py 2 locations

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