Skip to content

Commit 58fdabc

Browse files
committed
Simplify error message
1 parent 7e5dc4e commit 58fdabc

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

cli/cppcheckexecutor.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -329,11 +329,8 @@ static bool reportUnmatchedSuppressions(const std::list<SuppressionList::Suppres
329329
if (!s.fileName.empty()) {
330330
callStack.emplace_back(s.fileName, s.lineNumber, 0);
331331
}
332-
if (s.isPolyspace) {
333-
errorLogger.reportErr(::ErrorMessage(std::move(callStack), "", Severity::information, "Unmatched polyspace suppression: " + s.errorId, "unmatchedPolyspaceSuppression", Certainty::normal));
334-
} else {
335-
errorLogger.reportErr(::ErrorMessage(std::move(callStack), "", Severity::information, "Unmatched suppression: " + s.errorId, "unmatchedSuppression", Certainty::normal));
336-
}
332+
const std::string unmatchedSuppressionId = s.isPolyspace ? "unmatchedPolyspaceSuppression" : "unmatchedSuppression";
333+
errorLogger.reportErr(::ErrorMessage(std::move(callStack), "", Severity::information, "Unmatched suppression: " + s.errorId, unmatchedSuppressionId, Certainty::normal));
337334
err = true;
338335
}
339336
return err;

0 commit comments

Comments
 (0)