Split the CWE string and extract the id >>> get_cwe_id("CWE-20") 20
(cwe_string: str)
| 429 | |
| 430 | |
| 431 | def 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 | |
| 441 | def create_weaknesses_list(cwe_strings: str): |
no outgoing calls
no test coverage detected