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

Method saveStatistics

gui/resultsview.cpp:193–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191}
192
193void ResultsView::saveStatistics(const QString &filename) const
194{
195 QFile f(filename);
196 if (!f.open(QIODevice::Text | QIODevice::Append))
197 return;
198 QTextStream ts(&f);
199 ts << '[' << QDate::currentDate().toString("dd.MM.yyyy") << "]\n";
200 ts << QDateTime::currentMSecsSinceEpoch() << '\n';
201 for (const QString& tool : mStatistics->getTools()) {
202 ts << tool << "-error:" << mStatistics->getCount(tool, ShowTypes::ShowErrors) << '\n';
203 ts << tool << "-warning:" << mStatistics->getCount(tool, ShowTypes::ShowWarnings) << '\n';
204 ts << tool << "-style:" << mStatistics->getCount(tool, ShowTypes::ShowStyle) << '\n';
205 ts << tool << "-performance:" << mStatistics->getCount(tool, ShowTypes::ShowPerformance) << '\n';
206 ts << tool << "-portability:" << mStatistics->getCount(tool, ShowTypes::ShowPortability) << '\n';
207 }
208}
209
210void ResultsView::updateFromOldReport(const QString &filename) const
211{

Callers 1

analysisDoneMethod · 0.80

Calls 4

getToolsMethod · 0.80
openMethod · 0.45
toStringMethod · 0.45
getCountMethod · 0.45

Tested by

no test coverage detected