Code Duplication    Length = 33-36 lines in 2 locations

gvm/protocols/gmpv8.py 1 location

@@ 98-133 (lines=36) @@
95
PROTOCOL_VERSION = (8,)
96
97
98
class EntityType(Enum):
99
    """ Enum for entity types """
100
101
    AGENT = "note"
102
    ALERT = "alert"
103
    ASSET = "asset"
104
    CERT_BUND_ADV = "cert_bund_adv"
105
    CPE = "cpe"
106
    CREDENTIAL = "credential"
107
    CVE = "cve"
108
    DFN_CERT_ADV = "dfn_cert_adv"
109
    FILTER = "filter"
110
    GROUP = "group"
111
    HOST = "host"
112
    INFO = "info"
113
    NOTE = "note"
114
    NVT = "nvt"
115
    OPERATING_SYSTEM = "os"
116
    OVALDEF = "ovaldef"
117
    OVERRIDE = "override"
118
    PERMISSION = "permission"
119
    PORT_LIST = "port_list"
120
    REPORT = "report"
121
    REPORT_FORMAT = "report_format"
122
    RESULT = "result"
123
    ROLE = "role"
124
    SCAN_CONFIG = "config"
125
    SCANNER = "scanner"
126
    SCHEDULE = "schedule"
127
    TAG = "tag"
128
    TARGET = "target"
129
    TASK = "task"
130
    USER = "user"
131
132
    TICKET = "ticket"
133
    VULNERABILITY = "vuln"
134
135
136
def get_entity_type_from_string(

gvm/protocols/gmpv7.py 1 location

@@ 291-323 (lines=33) @@
288
        )
289
290
291
class EntityType(Enum):
292
    """ Enum for entity types """
293
294
    AGENT = "note"
295
    ALERT = "alert"
296
    ASSET = "asset"
297
    CERT_BUND_ADV = "cert_bund_adv"
298
    CPE = "cpe"
299
    CREDENTIAL = "credential"
300
    CVE = "cve"
301
    DFN_CERT_ADV = "dfn_cert_adv"
302
    FILTER = "filter"
303
    GROUP = "group"
304
    HOST = "host"
305
    INFO = "info"
306
    NOTE = "note"
307
    NVT = "nvt"
308
    OPERATING_SYSTEM = "os"
309
    OVALDEF = "ovaldef"
310
    OVERRIDE = "override"
311
    PERMISSION = "permission"
312
    PORT_LIST = "port_list"
313
    REPORT = "report"
314
    REPORT_FORMAT = "report_format"
315
    RESULT = "result"
316
    ROLE = "role"
317
    SCAN_CONFIG = "config"
318
    SCANNER = "scanner"
319
    SCHEDULE = "schedule"
320
    TAG = "tag"
321
    TARGET = "target"
322
    TASK = "task"
323
    USER = "user"
324
325
326
def get_entity_type_from_string(