TODO: this logic is duplicated in CppCheck::reportErr()
| 39 | |
| 40 | // TODO: this logic is duplicated in CppCheck::reportErr() |
| 41 | bool 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 | |
| 64 | void Executor::reportStatus(std::size_t fileindex, std::size_t filecount, std::size_t sizedone, std::size_t sizetotal) |
| 65 | { |
no test coverage detected