fix(parser/cppcheck): backward compatibility
This commit is contained in:
parent
d09a172a2d
commit
f0349a461b
4
.gitmodules
vendored
4
.gitmodules
vendored
|
@ -70,3 +70,7 @@
|
||||||
path = examples/keyword/script
|
path = examples/keyword/script
|
||||||
url = ssh://git@focs.ji.sjtu.edu.cn:2222/JOJ/JOJ3-examples.git
|
url = ssh://git@focs.ji.sjtu.edu.cn:2222/JOJ/JOJ3-examples.git
|
||||||
branch = keyword/script
|
branch = keyword/script
|
||||||
|
[submodule "examples/cppcheck/simple"]
|
||||||
|
path = examples/cppcheck/simple
|
||||||
|
url = ssh://git@focs.ji.sjtu.edu.cn:2222/JOJ/JOJ3-examples.git
|
||||||
|
branch = cppcheck/simple
|
||||||
|
|
1
examples/cppcheck/simple
Submodule
1
examples/cppcheck/simple
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit e740770605acd5a003db18afde1b1e829fd2bfec
|
|
@ -45,7 +45,6 @@ func GetResult(records []Record, conf Conf) (string, int, error) {
|
||||||
var severityCounts [UNKNOWN + 1]int
|
var severityCounts [UNKNOWN + 1]int
|
||||||
score := conf.Score
|
score := conf.Score
|
||||||
// TODO: remove me
|
// TODO: remove me
|
||||||
if len(conf.Matches) == 0 {
|
|
||||||
var severityScore [UNKNOWN + 1]int
|
var severityScore [UNKNOWN + 1]int
|
||||||
for _, match := range conf.Matches {
|
for _, match := range conf.Matches {
|
||||||
severities := match.Severity
|
severities := match.Severity
|
||||||
|
@ -58,6 +57,11 @@ func GetResult(records []Record, conf Conf) (string, int, error) {
|
||||||
severityScore[int(severity)] = score
|
severityScore[int(severity)] = score
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
totalSeverityScore := 0
|
||||||
|
for _, score := range severityScore {
|
||||||
|
totalSeverityScore += score
|
||||||
|
}
|
||||||
|
if totalSeverityScore != 0 {
|
||||||
for _, record := range records {
|
for _, record := range records {
|
||||||
severity, err := severityFromString(record.Severity)
|
severity, err := severityFromString(record.Severity)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user