MCPcopy Index your code
hub / github.com/aboutcode-org/vulnerablecode / getStates

Method getStates

vulnerabilities/lib_oval.py:380–401  ·  view source on GitHub ↗

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

(self)

Source from the content-addressed store, hash-verified

378 return [OvalObject(element) for element in element_list]
379
380 def getStates(self):
381 """
382 Returns a list of all states in this OvalDocument where each list item is of type OvalState
383 Returns None if no states could be found
384
385 @rtype: List
386 @return: All states in the OVAL document or None if none were found
387 """
388 root = self.getDocumentRoot()
389 if not root:
390 return None
391
392 stateroot = root.find("def:states", OvalDocument.NS_DEFAULT)
393
394 if stateroot is None:
395 return None
396
397 element_list = list(stateroot)
398 if not element_list:
399 return None
400
401 return [OvalState(element) for element in element_list]
402
403 def getVariables(self):
404 """

Callers 3

__init__Method · 0.95

Calls 2

getDocumentRootMethod · 0.95
OvalStateClass · 0.85