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

Method reAnalyzeSelected

gui/mainwindow.cpp:1371–1417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1369}
1370
1371void MainWindow::reAnalyzeSelected(const QStringList& files)
1372{
1373 if (files.empty())
1374 return;
1375 if (mThread->isChecking())
1376 return;
1377
1378 if (mProjectFile) {
1379 // Clear details, statistics and progress
1380 mUI->mResults->clear(false);
1381 for (int i = 0; i < files.size(); ++i)
1382 mUI->mResults->clearRecheckFile(files[i]);
1383
1384 analyzeProject(mProjectFile, files);
1385 return;
1386 }
1387
1388 Settings checkSettings;
1389 auto supprs = std::make_shared<Suppressions>();
1390 if (!getCppcheckSettings(checkSettings, *supprs))
1391 return;
1392
1393 // Clear details, statistics and progress
1394 mUI->mResults->clear(false);
1395 for (int i = 0; i < files.size(); ++i)
1396 mUI->mResults->clearRecheckFile(files[i]);
1397
1398 mCurrentDirectory = mUI->mResults->getCheckDirectory();
1399 FileList pathList;
1400 pathList.addPathList(files);
1401 if (mProjectFile)
1402 pathList.addExcludeList(mProjectFile->getExcludedPaths());
1403
1404 std::list<FileWithDetails> fdetails = enrichFilesForAnalysis(pathList.getFileList(), checkSettings);
1405
1406 checkLockDownUI(); // lock UI while checking
1407 mUI->mResults->checkingStarted(fdetails.size());
1408 mThread->setCheckFiles(std::move(fdetails));
1409
1410 // Saving last check start time, otherwise unchecked modified files will not be
1411 // considered in "Modified Files Check" performed after "Selected Files Check"
1412 // TODO: Should we store per file CheckStartTime?
1413 QDateTime saveCheckStartTime = mThread->getCheckStartTime();
1414 mThread->check(checkSettings, supprs);
1415 mUI->mResults->setCheckSettings(checkSettings);
1416 mThread->setCheckStartTime(std::move(saveCheckStartTime));
1417}
1418
1419void MainWindow::reAnalyze(bool all)
1420{

Callers

nothing calls this directly

Calls 15

getCheckDirectoryMethod · 0.80
addExcludeListMethod · 0.80
getFileListMethod · 0.80
checkingStartedMethod · 0.80
setCheckFilesMethod · 0.80
getCheckStartTimeMethod · 0.80
setCheckSettingsMethod · 0.80
setCheckStartTimeMethod · 0.80
emptyMethod · 0.45
isCheckingMethod · 0.45
clearMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected