MCPcopy Create free account
hub / github.com/aboutcode-org/vulnerablecode / getDefinitions

Method getDefinitions

vulnerabilities/lib_oval.py:311–332  ·  view source on GitHub ↗

Returns a list of all definitions found in this OvalDocment where each item in the list is of type OvalDefinition Returns None if no definitions could be found @rtype: List @return: All definitions in the OVAL document or None if none were found

(self)

Source from the content-addressed store, hash-verified

309 return gen
310
311 def getDefinitions(self):
312 """
313 Returns a list of all definitions found in this OvalDocment where each item in the list is of type OvalDefinition
314 Returns None if no definitions could be found
315
316 @rtype: List
317 @return: All definitions in the OVAL document or None if none were found
318 """
319 root = self.getDocumentRoot()
320 if not root:
321 return None
322
323 defroot = root.find("def:definitions", OvalDocument.NS_DEFAULT)
324
325 if defroot is None:
326 return None
327
328 element_list = list(defroot)
329 if not element_list:
330 return None
331
332 return [OvalDefinition(element) for element in element_list]
333
334 def getTests(self):
335 """

Callers 2

__init__Method · 0.95
__init__Method · 0.80

Calls 2

getDocumentRootMethod · 0.95
OvalDefinitionClass · 0.85

Tested by

no test coverage detected