Code Duplication    Length = 13-14 lines in 2 locations

ospd_openvas/preferencehandler.py 2 locations

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