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

Method hasToLog

cli/executor.cpp:41–62  ·  view source on GitHub ↗

TODO: this logic is duplicated in CppCheck::reportErr()

Source from the content-addressed store, hash-verified

39
40// TODO: this logic is duplicated in CppCheck::reportErr()
41bool Executor::hasToLog(const ErrorMessage &msg)
42{
43 if (msg.severity == Severity::internal)
44 return true;
45
46 if (!mSuppressions.nomsg.isSuppressed(msg, {}))
47 {
48 // TODO: there should be no need for verbose and default messages here
49 std::string errmsg = msg.toString(mSettings.verbose, mSettings.templateFormat, mSettings.templateLocation);
50 if (errmsg.empty())
51 return false;
52
53 if (mSettings.emitDuplicates)
54 return true;
55
56 std::lock_guard<std::mutex> lg(mErrorListSync);
57 if (mErrorList.emplace(std::move(errmsg)).second) {
58 return true;
59 }
60 }
61 return false;
62}
63
64void Executor::reportStatus(std::size_t fileindex, std::size_t filecount, std::size_t sizedone, std::size_t sizetotal)
65{

Callers 1

reportErrMethod · 0.80

Calls 3

isSuppressedMethod · 0.45
toStringMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected