);
};
- renderFinding(finding: SecurityHotspot, isCWE?: boolean): React.ReactFragment {
+ renderFinding(
+ finding: SecurityHotspot,
+ isCWE?: boolean,
+ parent?: SecurityHotspot
+ ): React.ReactFragment {
const { branchLike, component, type } = this.props;
const params: { [name: string]: string | undefined } = {
...getBranchLikeQuery(branchLike),
types: 'SECURITY_HOTSPOT'
};
- params[isCWE ? 'cwe' : type] = finding.cwe || finding.category;
+ if (isCWE && parent) {
+ params['cwe'] = finding.cwe;
+ params[type] = parent.category;
+ } else {
+ params[type] = finding.category;
+ }
const subFindings =
this.props.showCWE && finding.distribution
- ? finding.distribution.map(f => this.renderFinding(f, true))
+ ? finding.distribution.map(f => this.renderFinding(f, true, finding))
: null;
const title = getRatingTooltip('security_rating', finding.vulnerabilityRating || 1);
"query": Object {
"cwe": "42",
"id": "foo",
+ "owaspTop10": "a1",
"resolved": "false",
"types": "VULNERABILITY",
},
"query": Object {
"cwe": "42",
"id": "foo",
+ "owaspTop10": "a1",
"resolved": "false",
"types": "VULNERABILITY",
},
"query": Object {
"cwe": "42",
"id": "foo",
+ "owaspTop10": "a1",
"resolved": "false",
"statuses": "OPEN,REOPENED",
"types": "SECURITY_HOTSPOT",
"query": Object {
"cwe": "42",
"id": "foo",
+ "owaspTop10": "a1",
"resolutions": "FIXED",
"statuses": "RESOLVED",
"types": "SECURITY_HOTSPOT",
"query": Object {
"cwe": "42",
"id": "foo",
+ "owaspTop10": "a1",
"resolutions": "WONTFIX",
"statuses": "RESOLVED",
"types": "SECURITY_HOTSPOT",