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

Method create

vulnerabilities/lib_oval.py:1026–1044  ·  view source on GitHub ↗

Create an OvalElement of the proper OVAL element type

(oval_type, element)

Source from the content-addressed store, hash-verified

1024
1025 @staticmethod
1026 def create(oval_type, element):
1027 """
1028 Create an OvalElement of the proper OVAL element type
1029 """
1030 if not oval_type:
1031 return None
1032
1033 if oval_type == OvalDefinition.DEFINITION:
1034 return OvalDefinition(element)
1035 elif oval_type == OvalDefinition.TEST:
1036 return OvalTest(element)
1037 elif oval_type == OvalDefinition.OBJECT:
1038 return OvalObject(element)
1039 elif oval_type == OvalDefinition.STATE:
1040 return OvalState(element)
1041 elif oval_type == OvalDefinition.VARIABLE:
1042 return OvalVariable(element)
1043 else:
1044 return None
1045
1046
1047class OvalDefinition(OvalElement):

Callers 15

asOvalElementMethod · 0.45
from_purlMethod · 0.45
update_or_createMethod · 0.45
enqueue_pipelineFunction · 0.45
insert_advisory_v2Function · 0.45
setUpMethod · 0.45
setUpMethod · 0.45
create_advisoryMethod · 0.45
test_transitive_mergeMethod · 0.45

Calls 5

OvalDefinitionClass · 0.85
OvalTestClass · 0.85
OvalObjectClass · 0.85
OvalStateClass · 0.85
OvalVariableClass · 0.85

Tested by 15

setUpMethod · 0.36
setUpMethod · 0.36
create_advisoryMethod · 0.36
test_transitive_mergeMethod · 0.36
setUpMethod · 0.36
test_package_changelogFunction · 0.36