Skip to content

Commit 4b9ced2

Browse files
felickzCopilot
andauthored
Update src/main.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 869c6d7 commit 4b9ced2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,12 @@ JSONPath({
104104
if (tag.startsWith(codeQlCweTagPrefix)) {
105105
const cweId = tag.replace(codeQlCweTagPrefix, '')
106106
// Normalize CWE ID by converting to integer to remove leading zeros
107-
const normalizedCweId = String(parseInt(cweId, 10))
107+
const parsedCweId = parseInt(cweId, 10)
108108
// Skip if the CWE ID is not a valid number
109-
if (normalizedCweId === 'NaN') {
109+
if (Number.isNaN(parsedCweId)) {
110110
continue
111111
}
112+
const normalizedCweId = String(parsedCweId)
112113
if (cweIds.includes(normalizedCweId)) {
113114
tags.push(securityStandardTag)
114115
tags.push(...cweCategories[normalizedCweId])

0 commit comments

Comments
 (0)