File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -195,6 +195,16 @@ void linkifyShellCheckMsg(std::string *pMsg)
195
195
" \\ 1SC\\ 2\\ 3</a>" );
196
196
}
197
197
198
+ void printCweLink (std::ostream &str, const int cwe)
199
+ {
200
+ str << " <a href=\" https://cwe.mitre.org/data/definitions/"
201
+ << cwe << " .html\" "
202
+ << " title=\" definition of CWE-"
203
+ << cwe << " by MITRE\" >"
204
+ << " CWE-" << cwe
205
+ << " </a>" ;
206
+ }
207
+
198
208
class HtmlWriterCore {
199
209
public:
200
210
HtmlWriterCore (
@@ -441,8 +451,11 @@ void HtmlWriter::handleDef(const Defect &def)
441
451
442
452
d->str << " <b>Error: <span style='background: #C0FF00;'>"
443
453
<< HtmlLib::escapeTextInline (def.checker ) << " </span>" ;
444
- if (def.cwe )
445
- d->str << " (CWE-" << def.cwe << " )" ;
454
+ if (def.cwe ) {
455
+ d->str << " (" ;
456
+ printCweLink (d->str , def.cwe );
457
+ d->str << " )" ;
458
+ }
446
459
else
447
460
d->str << HtmlLib::escapeTextInline (def.annotation );
448
461
d->str << " :</b>" ;
You can’t perform that action at this time.
0 commit comments