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

Method analyzeFiles

gui/mainwindow.cpp:806–842  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

804}
805
806void MainWindow::analyzeFiles()
807{
808 Settings::terminate(false);
809
810 QStringList selected = selectFilesToAnalyze(QFileDialog::ExistingFiles);
811
812 const QString file0 = (!selected.empty() ? selected[0].toLower() : QString());
813 if (file0.endsWith(".sln")
814 || file0.endsWith(".slnx")
815 || file0.endsWith(".vcxproj")
816 || file0.endsWith(compile_commands_json)
817 || file0.endsWith(".bpr")) {
818 ImportProject p;
819 p.import(selected[0].toStdString());
820
821 if (file0.endsWith(".sln") || file0.endsWith(".slnx")) {
822 QStringList configs;
823 for (auto it = p.fileSettings.cbegin(); it != p.fileSettings.cend(); ++it) {
824 const QString cfg(QString::fromStdString(it->cfg));
825 if (!configs.contains(cfg))
826 configs.push_back(cfg);
827 }
828 configs.sort();
829
830 bool ok = false;
831 const QString cfg = QInputDialog::getItem(this, tr("Select configuration"), tr("Select the configuration that will be analyzed"), configs, 0, false, &ok);
832 if (!ok)
833 return;
834 p.ignoreOtherConfigs(cfg.toStdString());
835 }
836
837 doAnalyzeProject(p); // TODO: avoid copy
838 return;
839 }
840
841 doAnalyzeFiles(selected);
842}
843
844void MainWindow::analyzeDirectory()
845{

Callers

nothing calls this directly

Calls 8

terminateFunction · 0.85
endsWithMethod · 0.80
importMethod · 0.80
ignoreOtherConfigsMethod · 0.80
QStringClass · 0.70
emptyMethod · 0.45
containsMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected