feat(parser/cppcheck): match both id and severity

This commit is contained in:
张泊明518370910136 2024-11-04 04:07:24 -05:00
parent f2000a2a11
commit bcaed579e5
GPG Key ID: D47306D7062CDA9D

View File

@ -87,7 +87,8 @@ func GetResult(records []Record, conf Conf) (string, int, error) {
for _, record := range records {
for _, match := range conf.Matches {
for _, keyword := range match.Keywords {
if strings.Contains(record.Id, keyword) {
if strings.Contains(record.Id, keyword) ||
strings.Contains(record.Severity, keyword) {
matchCount[keyword] += 1
scoreChange[keyword] += -match.Score
score += -match.Score