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

Method getVariables

vulnerabilities/lib_oval.py:403–424  ·  view source on GitHub ↗

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

(self)

Source from the content-addressed store, hash-verified

401 return [OvalState(element) for element in element_list]
402
403 def getVariables(self):
404 """
405 Returns a list of all variables in this OvalDocument where each list item is of type OvalVariable
406 Returns None if no variables could be found
407
408 @rtype: List
409 @return: All variables in the OVAL document or None if none were found
410 """
411 root = self.getDocumentRoot()
412 if not root:
413 return None
414
415 varroot = root.find("def:variables", OvalDocument.NS_DEFAULT)
416
417 if varroot is None:
418 return None
419
420 element_list = list(varroot)
421 if not element_list:
422 return None
423
424 return [OvalVariable(element) for element in element_list]
425
426 def getElementByID(self, ovalid):
427 """

Callers 1

__init__Method · 0.95

Calls 2

getDocumentRootMethod · 0.95
OvalVariableClass · 0.85

Tested by

no test coverage detected