| 119 | } |
| 120 | |
| 121 | unsigned int check(const FileWithDetails *file, const FileSettings *fs) { |
| 122 | CppCheck fileChecker(mSettings, mSuppressions, mLogForwarder, mTimerResults, false, mExecuteCommand); |
| 123 | |
| 124 | unsigned int result; |
| 125 | if (fs) { |
| 126 | // file settings.. |
| 127 | result = fileChecker.check(*fs); |
| 128 | } else { |
| 129 | // Read file from a file |
| 130 | result = fileChecker.check(*file); |
| 131 | } |
| 132 | for (const auto& suppr : mSuppressions.nomsg.getSuppressions()) { |
| 133 | // need to transfer all inline suppressions because these are used later on |
| 134 | if (suppr.isInline) { |
| 135 | const std::string err = mSuppressions.nomsg.addSuppression(suppr); |
| 136 | if (!err.empty()) { |
| 137 | // TODO: only update state if it doesn't exist - otherwise propagate error |
| 138 | mSuppressions.nomsg.updateSuppressionState(suppr); // TODO: check result |
| 139 | } |
| 140 | continue; |
| 141 | } |
| 142 | |
| 143 | // propagate state of global suppressions |
| 144 | if (!suppr.isLocal()) { |
| 145 | mSuppressions.nomsg.updateSuppressionState(suppr); // TODO: check result |
| 146 | continue; |
| 147 | } |
| 148 | } |
| 149 | return result; |
| 150 | } |
| 151 | |
| 152 | void status(std::size_t fileSize) { |
| 153 | std::lock_guard<std::mutex> l(mFileSync); |
nothing calls this directly
no test coverage detected