File tree Expand file tree Collapse file tree 2 files changed +64
-2
lines changed Expand file tree Collapse file tree 2 files changed +64
-2
lines changed Original file line number Diff line number Diff line change @@ -165,13 +165,21 @@ void SarifTreeEncoder::serializeCweMap()
165165
166166 PTree cweList;
167167 const auto cwe = item.second ;
168- const auto cweStr = " CWE- " + std::to_string (cwe);
169- appendNode (&cweList, PTree (cweStr));
168+ const auto cweStr = std::to_string (cwe);
169+ appendNode (&cweList, PTree (" CWE- " + cweStr));
170170
171+ // properties.cwe[]
171172 PTree props;
172173 props.put_child (" cwe" , cweList);
173174 rule.put_child (" properties" , props);
174175
176+ // help.text
177+ PTree help;
178+ const auto helpText =
179+ " https://cwe.mitre.org/data/definitions/" + cweStr + " .html" ;
180+ help.put <std::string>(" text" , helpText);
181+ rule.put_child (" help" , help);
182+
175183 appendNode (&ruleList, rule);
176184 }
177185
Original file line number Diff line number Diff line change 1515 "cwe": [
1616 "CWE-762"
1717 ]
18+ },
19+ "help": {
20+ "text": "https://cwe.mitre.org/data/definitions/762.html"
1821 }
1922 },
2023 {
2326 "cwe": [
2427 "CWE-252"
2528 ]
29+ },
30+ "help": {
31+ "text": "https://cwe.mitre.org/data/definitions/252.html"
2632 }
2733 },
2834 {
3137 "cwe": [
3238 "CWE-569"
3339 ]
40+ },
41+ "help": {
42+ "text": "https://cwe.mitre.org/data/definitions/569.html"
3443 }
3544 },
3645 {
3948 "cwe": [
4049 "CWE-569"
4150 ]
51+ },
52+ "help": {
53+ "text": "https://cwe.mitre.org/data/definitions/569.html"
4254 }
4355 },
4456 {
4759 "cwe": [
4860 "CWE-561"
4961 ]
62+ },
63+ "help": {
64+ "text": "https://cwe.mitre.org/data/definitions/561.html"
5065 }
5166 },
5267 {
5570 "cwe": [
5671 "CWE-561"
5772 ]
73+ },
74+ "help": {
75+ "text": "https://cwe.mitre.org/data/definitions/561.html"
5876 }
5977 },
6078 {
6381 "cwe": [
6482 "CWE-561"
6583 ]
84+ },
85+ "help": {
86+ "text": "https://cwe.mitre.org/data/definitions/561.html"
6687 }
6788 },
6889 {
7192 "cwe": [
7293 "CWE-476"
7394 ]
95+ },
96+ "help": {
97+ "text": "https://cwe.mitre.org/data/definitions/476.html"
7498 }
7599 },
76100 {
79103 "cwe": [
80104 "CWE-687"
81105 ]
106+ },
107+ "help": {
108+ "text": "https://cwe.mitre.org/data/definitions/687.html"
82109 }
83110 },
84111 {
87114 "cwe": [
88115 "CWE-119"
89116 ]
117+ },
118+ "help": {
119+ "text": "https://cwe.mitre.org/data/definitions/119.html"
90120 }
91121 },
92122 {
95125 "cwe": [
96126 "CWE-119"
97127 ]
128+ },
129+ "help": {
130+ "text": "https://cwe.mitre.org/data/definitions/119.html"
98131 }
99132 },
100133 {
103136 "cwe": [
104137 "CWE-125"
105138 ]
139+ },
140+ "help": {
141+ "text": "https://cwe.mitre.org/data/definitions/125.html"
106142 }
107143 },
108144 {
111147 "cwe": [
112148 "CWE-686"
113149 ]
150+ },
151+ "help": {
152+ "text": "https://cwe.mitre.org/data/definitions/686.html"
114153 }
115154 },
116155 {
119158 "cwe": [
120159 "CWE-404"
121160 ]
161+ },
162+ "help": {
163+ "text": "https://cwe.mitre.org/data/definitions/404.html"
122164 }
123165 },
124166 {
127169 "cwe": [
128170 "CWE-404"
129171 ]
172+ },
173+ "help": {
174+ "text": "https://cwe.mitre.org/data/definitions/404.html"
130175 }
131176 },
132177 {
135180 "cwe": [
136181 "CWE-170"
137182 ]
183+ },
184+ "help": {
185+ "text": "https://cwe.mitre.org/data/definitions/170.html"
138186 }
139187 },
140188 {
143191 "cwe": [
144192 "CWE-120"
145193 ]
194+ },
195+ "help": {
196+ "text": "https://cwe.mitre.org/data/definitions/120.html"
146197 }
147198 },
148199 {
151202 "cwe": [
152203 "CWE-367"
153204 ]
205+ },
206+ "help": {
207+ "text": "https://cwe.mitre.org/data/definitions/367.html"
154208 }
155209 }
156210 ]
You can’t perform that action at this time.
0 commit comments