From f7a30fc99f20e431997f25bf96ef4afc0176b372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 18 Jan 2020 07:25:39 +0100 Subject: [PATCH] Rename Verification => Bughunting --- cli/cppcheckexecutor.cpp | 2 +- cli/cppcheckexecutor.h | 2 +- cli/threadexecutor.cpp | 2 +- cli/threadexecutor.h | 2 +- gui/newsuppressiondialog.cpp | 2 +- gui/threadresult.h | 2 +- lib/cppcheck.cpp | 4 ++-- lib/cppcheck.h | 2 +- lib/errorlogger.h | 2 +- lib/exprengine.cpp | 16 ++++++++-------- test/testcppcheck.cpp | 2 +- test/testsuite.h | 2 +- 12 files changed, 20 insertions(+), 20 deletions(-) diff --git a/cli/cppcheckexecutor.cpp b/cli/cppcheckexecutor.cpp index e88965493..c4b91e113 100644 --- a/cli/cppcheckexecutor.cpp +++ b/cli/cppcheckexecutor.cpp @@ -1091,7 +1091,7 @@ void CppCheckExecutor::reportErr(const ErrorLogger::ErrorMessage &msg) } } -void CppCheckExecutor::reportVerification(const std::string &str) +void CppCheckExecutor::bughuntingReport(const std::string &str) { if (!mSettings || str.empty()) return; diff --git a/cli/cppcheckexecutor.h b/cli/cppcheckexecutor.h index 04e5ad7f4..7f86256ae 100644 --- a/cli/cppcheckexecutor.h +++ b/cli/cppcheckexecutor.h @@ -81,7 +81,7 @@ public: */ void reportInfo(const ErrorLogger::ErrorMessage &msg) OVERRIDE; - void reportVerification(const std::string &str) OVERRIDE; + void bughuntingReport(const std::string &str) OVERRIDE; /** * Information about how many files have been checked diff --git a/cli/threadexecutor.cpp b/cli/threadexecutor.cpp index 2c503a97e..31594eaf6 100644 --- a/cli/threadexecutor.cpp +++ b/cli/threadexecutor.cpp @@ -348,7 +348,7 @@ void ThreadExecutor::reportInfo(const ErrorLogger::ErrorMessage &msg) writeToPipe(REPORT_INFO, msg.serialize()); } -void ThreadExecutor::reportVerification(const std::string &str) +void ThreadExecutor::bughuntingReport(const std::string &str) { writeToPipe(REPORT_VERIFICATION, str.c_str()); } diff --git a/cli/threadexecutor.h b/cli/threadexecutor.h index f6eb81022..408b665ef 100644 --- a/cli/threadexecutor.h +++ b/cli/threadexecutor.h @@ -54,7 +54,7 @@ public: void reportOut(const std::string &outmsg) OVERRIDE; void reportErr(const ErrorLogger::ErrorMessage &msg) OVERRIDE; void reportInfo(const ErrorLogger::ErrorMessage &msg) OVERRIDE; - void reportVerification(const std::string &str) OVERRIDE; + void bughuntingReport(const std::string &str) OVERRIDE; /** * @brief Add content to a file, to be used in unit testing. diff --git a/gui/newsuppressiondialog.cpp b/gui/newsuppressiondialog.cpp index 0265b0cb8..fe38c8ed9 100644 --- a/gui/newsuppressiondialog.cpp +++ b/gui/newsuppressiondialog.cpp @@ -16,7 +16,7 @@ NewSuppressionDialog::NewSuppressionDialog(QWidget *parent) : void reportErr(const ErrorLogger::ErrorMessage &msg) override { errorIds << QString::fromStdString(msg.id); } - void reportVerification(const std::string &/*str*/) override {} + void bughuntingReport(const std::string &/*str*/) override {} QStringList errorIds; }; diff --git a/gui/threadresult.h b/gui/threadresult.h index ecbf98745..99f7edee7 100644 --- a/gui/threadresult.h +++ b/gui/threadresult.h @@ -74,7 +74,7 @@ public: */ void reportOut(const std::string &outmsg) override; void reportErr(const ErrorLogger::ErrorMessage &msg) override; - void reportVerification(const std::string &/*str*/) override {} + void bughuntingReport(const std::string &/*str*/) override {} public slots: diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index 1b4b895ba..12333f790 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -1286,9 +1286,9 @@ void CppCheck::reportStatus(unsigned int /*fileindex*/, unsigned int /*filecount } -void CppCheck::reportVerification(const std::string &str) +void CppCheck::bughuntingReport(const std::string &str) { - mErrorLogger.reportVerification(str); + mErrorLogger.bughuntingReport(str); } void CppCheck::getErrorMessages() diff --git a/lib/cppcheck.h b/lib/cppcheck.h index 2af225db2..7f185fa04 100644 --- a/lib/cppcheck.h +++ b/lib/cppcheck.h @@ -195,7 +195,7 @@ private: */ void reportOut(const std::string &outmsg) OVERRIDE; - void reportVerification(const std::string &str) OVERRIDE; + void bughuntingReport(const std::string &str) OVERRIDE; std::list mErrorList; Settings mSettings; diff --git a/lib/errorlogger.h b/lib/errorlogger.h index 6ce686180..a2d87d262 100644 --- a/lib/errorlogger.h +++ b/lib/errorlogger.h @@ -407,7 +407,7 @@ public: reportErr(msg); } - virtual void reportVerification(const std::string &str) = 0; + virtual void bughuntingReport(const std::string &str) = 0; /** * Report unmatched suppressions diff --git a/lib/exprengine.cpp b/lib/exprengine.cpp index 0a6cfffe8..1e05742e9 100644 --- a/lib/exprengine.cpp +++ b/lib/exprengine.cpp @@ -1794,7 +1794,7 @@ void ExprEngine::executeFunction(const Scope *functionScope, const Tokenizer *to } } - // Write a verification report + // Write a report if (bugHuntingReport) { report << "[function-report] " << Path::stripDirectoryPart(tokenizer->list.getFiles().at(functionScope->bodyStart->fileIndex())) << ":" @@ -1827,7 +1827,7 @@ void ExprEngine::runChecks(ErrorLogger *errorLogger, const Tokenizer *tokenizer, if (tok->astParent()->astOperand2() == tok && value.isEqual(dataBase, 0)) { dataBase->addError(tok->linenr()); std::list callstack{tok->astParent()}; - const char * const id = (tok->valueType() && tok->valueType()->isFloat()) ? "verificationDivByZeroFloat" : "verificationDivByZero"; + const char * const id = (tok->valueType() && tok->valueType()->isFloat()) ? "bughuntingDivByZeroFloat" : "bughuntingDivByZero"; ErrorLogger::ErrorMessage errmsg(callstack, &tokenizer->list, Severity::SeverityType::error, id, "There is division, cannot determine that there can't be a division by zero.", CWE(369), false); errorLogger->reportErr(errmsg); } @@ -1877,7 +1877,7 @@ void ExprEngine::runChecks(ErrorLogger *errorLogger, const Tokenizer *tokenizer, errorMessage += " Note that unsigned integer overflow is defined and will wrap around."; std::list callstack{tok}; - ErrorLogger::ErrorMessage errmsg(callstack, &tokenizer->list, Severity::SeverityType::error, "verificationIntegerOverflow", errorMessage, false); + ErrorLogger::ErrorMessage errmsg(callstack, &tokenizer->list, Severity::SeverityType::error, "bughuntingIntegerOverflow", errorMessage, false); errorLogger->reportErr(errmsg); }; #endif @@ -1943,7 +1943,7 @@ void ExprEngine::runChecks(ErrorLogger *errorLogger, const Tokenizer *tokenizer, dataBase->addError(tok->linenr()); std::list callstack{tok}; - ErrorLogger::ErrorMessage errmsg(callstack, &tokenizer->list, Severity::SeverityType::error, "verificationUninit", "Cannot determine that '" + tok->expressionString() + "' is initialized", CWE_USE_OF_UNINITIALIZED_VARIABLE, false); + ErrorLogger::ErrorMessage errmsg(callstack, &tokenizer->list, Severity::SeverityType::error, "bughuntingUninit", "Cannot determine that '" + tok->expressionString() + "' is initialized", CWE_USE_OF_UNINITIALIZED_VARIABLE, false); errorLogger->reportErr(errmsg); }; #endif @@ -1991,7 +1991,7 @@ void ExprEngine::runChecks(ErrorLogger *errorLogger, const Tokenizer *tokenizer, ErrorLogger::ErrorMessage errmsg(callstack, &tokenizer->list, Severity::SeverityType::error, - "verificationInvalidArgValue", + "bughuntingInvalidArgValue", "There is function call, cannot determine that " + std::to_string(num) + getOrdinalText(num) + " argument value meets the attribute " + bad, CWE(0), false); errorLogger->reportErr(errmsg); return; @@ -2040,7 +2040,7 @@ void ExprEngine::runChecks(ErrorLogger *errorLogger, const Tokenizer *tokenizer, if (err) { dataBase->addError(tok->linenr()); std::list callstack{tok}; - ErrorLogger::ErrorMessage errmsg(callstack, &tokenizer->list, Severity::SeverityType::error, "verificationInvalidArgValue", "There is function call, cannot determine that " + std::to_string(num) + getOrdinalText(num) + " argument value is valid. Bad value: " + bad, CWE(0), false); + ErrorLogger::ErrorMessage errmsg(callstack, &tokenizer->list, Severity::SeverityType::error, "bughuntingInvalidArgValue", "There is function call, cannot determine that " + std::to_string(num) + getOrdinalText(num) + " argument value is valid. Bad value: " + bad, CWE(0), false); errorLogger->reportErr(errmsg); break; } @@ -2055,7 +2055,7 @@ void ExprEngine::runChecks(ErrorLogger *errorLogger, const Tokenizer *tokenizer, if (v.second->isUninit()) { dataBase->addError(tok->linenr()); std::list callstack{tok}; - ErrorLogger::ErrorMessage errmsg(callstack, &tokenizer->list, Severity::SeverityType::error, "verificationUninitArg", "There is function call, cannot determine that " + std::to_string(num) + getOrdinalText(num) + " argument is initialized.", CWE_USE_OF_UNINITIALIZED_VARIABLE, false); + ErrorLogger::ErrorMessage errmsg(callstack, &tokenizer->list, Severity::SeverityType::error, "bughuntingUninitArg", "There is function call, cannot determine that " + std::to_string(num) + getOrdinalText(num) + " argument is initialized.", CWE_USE_OF_UNINITIALIZED_VARIABLE, false); errorLogger->reportErr(errmsg); break; } @@ -2079,5 +2079,5 @@ void ExprEngine::runChecks(ErrorLogger *errorLogger, const Tokenizer *tokenizer, if (settings->bugHuntingReport.empty()) std::cout << report.str(); else if (errorLogger) - errorLogger->reportVerification(report.str()); + errorLogger->bughuntingReport(report.str()); } diff --git a/test/testcppcheck.cpp b/test/testcppcheck.cpp index f4fc57a29..12e54103c 100644 --- a/test/testcppcheck.cpp +++ b/test/testcppcheck.cpp @@ -38,7 +38,7 @@ private: std::list id; void reportOut(const std::string & /*outmsg*/) OVERRIDE {} - void reportVerification(const std::string & /*str*/) OVERRIDE {} + void bughuntingReport(const std::string & /*str*/) OVERRIDE {} void reportErr(const ErrorLogger::ErrorMessage &msg) OVERRIDE { id.push_back(msg.id); diff --git a/test/testsuite.h b/test/testsuite.h index 19c893001..5339ed324 100644 --- a/test/testsuite.h +++ b/test/testsuite.h @@ -82,7 +82,7 @@ protected: void processOptions(const options& args); public: - void reportVerification(const std::string &/*str*/) OVERRIDE {} + void bughuntingReport(const std::string &/*str*/) OVERRIDE {} void reportOut(const std::string &outmsg) OVERRIDE; void reportErr(const ErrorLogger::ErrorMessage &msg) OVERRIDE; void run(const std::string &str);