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

Method getIndexSequence

vulnerabilities/lib_oval.py:787–808  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

785 self.setVersion(version)
786
787 def getIndexSequence(self):
788 ovalid = self.getId()
789 if not ovalid or ovalid is None:
790 return 1000
791
792 # Get the numeric index from the end of the OVAL ID
793 position = ovalid.rfind(":")
794 if position < 0:
795 return 1000
796
797 try:
798 position = position + 1
799 index = ovalid[position:]
800
801 # Apply the modulus function to determine which bucket it belongs to
802 return int(int(index) / 1000 + 1) * 1000
803 # Or another way to do it:
804 # sequence = int(index)
805 # mod = sequence % 1000
806 # return sequence - mod + 1000
807 except Exception:
808 return 1000
809
810 def getFileName(self):
811 """

Callers

nothing calls this directly

Calls 1

getIdMethod · 0.95

Tested by

no test coverage detected