-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathResult.java
More file actions
88 lines (82 loc) · 3.46 KB
/
Result.java
File metadata and controls
88 lines (82 loc) · 3.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
package com.checkmarx.ast.results.result;
import com.checkmarx.ast.wrapper.CxConstants;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@lombok.Data
@JsonDeserialize()
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class Result {
private final String type;
private final String scaType;
private final String label;
private final String id;
private final String similarityId;
private final String status;
private String state;
private String severity;
private final String created;
private final String firstFoundAt;
private final String foundAt;
private final String firstScan;
private final String firstScanId;
private final String publishedAt;
private final String recommendations;
private final String description;
private final String descriptionHTML;
private final Data data;
private final Comments comments;
private final VulnerabilityDetails vulnerabilityDetails;
public Result(@JsonProperty("type") String type,
@JsonProperty("label") String label,
@JsonProperty("id") String id,
@JsonProperty("similarityId") String similarityId,
@JsonProperty("status") String status,
@JsonProperty("state") String state,
@JsonProperty("severity") String severity,
@JsonProperty("created") String created,
@JsonProperty("firstFoundAt") String firstFoundAt,
@JsonProperty("foundAt") String foundAt,
@JsonProperty("firstScan") String firstScan,
@JsonProperty("firstScanId") String firstScanId,
@JsonProperty("publishedAt") String publishedAt,
@JsonProperty("recommendations") String recommendations,
@JsonProperty("description") String description,
@JsonProperty("descriptionHTML") String descriptionHTML,
@JsonProperty("data") Data data,
@JsonProperty("comments") Comments comments,
@JsonProperty("vulnerabilityDetails") VulnerabilityDetails vulnerabilityDetails,
@JsonProperty("scaType") String scaType) {
this.type = normalizeType(type);
this.scaType=scaType;
this.label = label;
this.id = id;
this.similarityId = similarityId;
this.status = status;
this.state = state;
this.severity = severity;
this.created = created;
this.firstFoundAt = firstFoundAt;
this.foundAt = foundAt;
this.firstScan = firstScan;
this.firstScanId = firstScanId;
this.publishedAt = publishedAt;
this.recommendations = recommendations;
this.description = description;
this.descriptionHTML = descriptionHTML;
this.data = data;
this.comments = comments;
this.vulnerabilityDetails = vulnerabilityDetails;
}
/**
* Normalizes special-case types coming from JSON into internal constants.
*/
private static String normalizeType(String rawType) {
if ("sscs-secret-detection".equals(rawType)) {
return CxConstants.SECRET_DETECTION;
}
return rawType; // leave other engine types unchanged
}
}