MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / fromErrorMessage

Method fromErrorMessage

lib/suppressions.cpp:44–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42static const char ID_CHECKERSREPORT[] = "checkersReport";
43
44SuppressionList::ErrorMessage SuppressionList::ErrorMessage::fromErrorMessage(const ::ErrorMessage &msg, const std::set<std::string> &macroNames)
45{
46 SuppressionList::ErrorMessage ret;
47 ret.hash = msg.hash;
48 ret.errorId = msg.id;
49 if (!msg.callStack.empty()) {
50 ret.setFileName(msg.callStack.back().getfile(false));
51 ret.lineNumber = msg.callStack.back().line;
52 } else {
53 ret.setFileName(msg.file0);
54 ret.lineNumber = SuppressionList::Suppression::NO_LINE;
55 }
56 ret.certainty = msg.certainty;
57 ret.symbolNames = msg.symbolNames();
58 ret.macroNames = macroNames;
59 return ret;
60}
61
62static bool isAcceptedErrorIdChar(char c)
63{

Callers

nothing calls this directly

Calls 3

getfileMethod · 0.80
emptyMethod · 0.45
setFileNameMethod · 0.45

Tested by

no test coverage detected