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

Method check

gui/threadhandler.cpp:97–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97void ThreadHandler::check(const Settings &settings, const std::shared_ptr<Suppressions>& supprs)
98{
99 if (mResults.getFileCount() == 0 || mRunningThreadCount > 0 || settings.jobs == 0) {
100 qDebug() << "Can't start checking if there's no files to check or if check is in progress.";
101 emit done();
102 return;
103 }
104
105 mCheckSettings = settings;
106 mCheckSuppressions = supprs;
107
108 createThreads(mCheckSettings.jobs);
109
110 mRunningThreadCount = mThreads.size();
111 mRunningThreadCount = std::min(mResults.getFileCount(), mRunningThreadCount);
112
113 mCheckAddonsAndTools = mAddonsAndTools;
114 for (const std::string& addon: mCheckSettings.addons) {
115 QString s = QString::fromStdString(addon);
116 if (!mCheckAddonsAndTools.contains(s))
117 mCheckAddonsAndTools << s;
118 }
119
120 mCtuInfo.clear();
121
122 for (int i = 0; i < mRunningThreadCount; i++) {
123 setupCheckThread(*mThreads[i]);
124 mThreads[i]->start();
125 }
126
127 // Date and time when checking starts..
128 mCheckStartTime = QDateTime::currentDateTime();
129
130 mAnalyseWholeProgram = true;
131
132 mTimer.start();
133}
134
135bool ThreadHandler::isChecking() const
136{

Callers 5

doAnalyzeProjectMethod · 0.45
doAnalyzeFilesMethod · 0.45
reAnalyzeSelectedMethod · 0.45
reAnalyzeMethod · 0.45
runMethod · 0.45

Calls 4

getFileCountMethod · 0.80
sizeMethod · 0.45
containsMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected