shared/templates/audit_rules_file_deletion_events/template.py
Similar blocks of code found in 2 locations. Consider refactoring.def _audit_rules_file_deletion_events(data, lang):Similar blocks of code found in 2 locations. Consider refactoring. if lang == "bash":Similar blocks of code found in 2 locations. Consider refactoring. if "syscall_grouping" in data:Similar blocks of code found in 2 locations. Consider refactoring. # Make it easier to tranform the syscall_grouping into a Bash arraySimilar blocks of code found in 2 locations. Consider refactoring. data["syscall_grouping"] = " ".join(data["syscall_grouping"])Similar blocks of code found in 2 locations. Consider refactoring. elif lang == "ansible":Similar blocks of code found in 2 locations. Consider refactoring. if "name" in data:Similar blocks of code found in 2 locations. Consider refactoring. # Tranform the syscall into a Ansible listSimilar blocks of code found in 2 locations. Consider refactoring. # The syscall is under 'name'Similar blocks of code found in 2 locations. Consider refactoring. data["name"] = [data["name"]]Similar blocks of code found in 2 locations. Consider refactoring. if "syscall_grouping" not in data:Similar blocks of code found in 2 locations. Consider refactoring. # Ensure that syscall_grouping is a listSimilar blocks of code found in 2 locations. Consider refactoring. data["syscall_grouping"] = []Similar blocks of code found in 2 locations. Consider refactoring. return dataSimilar blocks of code found in 2 locations. Consider refactoring. Similar blocks of code found in 2 locations. Consider refactoring. Similar blocks of code found in 2 locations. Consider refactoring.def preprocess(data, lang):Similar blocks of code found in 2 locations. Consider refactoring. return _audit_rules_file_deletion_events(data, lang)