Code Duplication    Length = 13-14 lines in 2 locations

ospd_openvas/preferencehandler.py 2 locations

@@ 447-460 (lines=14) @@
444
        else:
445
            return
446
447
        if target_options:
448
            alive_test_ports = target_options.get('alive_test_ports')
449
            # Alive test was speciefied as bit field.
450
            alive_test = target_options.get('alive_test')
451
            # Alive test was speciefied as individual methods.
452
            alive_test_methods = target_options.get('alive_test_methods')
453
            # <alive_test> takes precedence over <alive_test_methods>
454
            if alive_test is None and alive_test_methods:
455
                alive_test = alive_test_methods_to_bit_field(
456
                    icmp=target_options.get('icmp') == '1',
457
                    tcp_syn=target_options.get('tcp_syn') == '1',
458
                    tcp_ack=target_options.get('tcp_ack') == '1',
459
                    arp=target_options.get('arp') == '1',
460
                    consider_alive=target_options.get('consider_alive') == '1',
461
                )
462
463
        if alive_test is not None:
@@ 319-331 (lines=13) @@
316
        target_opt_prefs_list = {}
317
        alive_test = None
318
319
        if target_options:
320
            # Alive test speciefied as bit field.
321
            alive_test = target_options.get('alive_test')
322
            # Alive test speciefied as individual methods.
323
            alive_test_methods = target_options.get('alive_test_methods')
324
            # alive_test takes precedence over alive_test_methods
325
            if alive_test is None and alive_test_methods:
326
                alive_test = alive_test_methods_to_bit_field(
327
                    icmp=target_options.get('icmp') == '1',
328
                    tcp_syn=target_options.get('tcp_syn') == '1',
329
                    tcp_ack=target_options.get('tcp_ack') == '1',
330
                    arp=target_options.get('arp') == '1',
331
                    consider_alive=target_options.get('consider_alive') == '1',
332
                )
333
334
        if target_options and alive_test: