File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
src/Shared/Components/Security Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ import {
32
32
TablePropsType ,
33
33
} from '../types'
34
34
import { OpenDetailViewButton } from '../components'
35
+ import { getCVEUrlFromCVEName } from '../../utils'
35
36
36
37
export const getCodeScanVulnerabilities = ( data : CodeScan [ 'vulnerability' ] ) => ( {
37
38
headers : [
@@ -57,7 +58,7 @@ export const getCodeScanVulnerabilities = (data: CodeScan['vulnerability']) => (
57
58
/* FIXME: which ones should be linked and which ones should not? */
58
59
component : (
59
60
< a
60
- href = { `https://cve.mitre.org/cgi-bin/cvename.cgi?name= ${ element . cveId } ` }
61
+ href = { getCVEUrlFromCVEName ( element . cveId ) }
61
62
rel = "noopener noreferrer"
62
63
target = "_blank"
63
64
data-testid = "security-vulnerability-detail--cve-id"
Original file line number Diff line number Diff line change @@ -20,3 +20,6 @@ export const getSeverityCountFromSummary = (
20
20
low : scanResultSeverities ?. LOW || 0 ,
21
21
unknown : scanResultSeverities ?. UNKNOWN || 0 ,
22
22
} )
23
+
24
+ export const getCVEUrlFromCVEName = ( cveName : string ) : string =>
25
+ `https://cve.mitre.org/cgi-bin/cvename.cgi?name=${ cveName } `
You can’t perform that action at this time.
0 commit comments