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

Function get_cwe_id

vulnerabilities/utils.py:431–438  ·  view source on GitHub ↗

Split the CWE string and extract the id >>> get_cwe_id("CWE-20") 20

(cwe_string: str)

Source from the content-addressed store, hash-verified

429
430
431def get_cwe_id(cwe_string: str) -> int:
432 """
433 Split the CWE string and extract the id
434 >>> get_cwe_id("CWE-20")
435 20
436 """
437 cwe_id = cwe_string.split("-")[1]
438 return int(cwe_id)
439
440
441def create_weaknesses_list(cwe_strings: str):

Callers 8

weaknessesMethod · 0.90
parse_cve_advisoryMethod · 0.90
weaknessesMethod · 0.90
parse_cve_advisoryFunction · 0.90
create_weaknesses_listFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected