diff --git a/.github/workflows/scriptcheck.yml b/.github/workflows/scriptcheck.yml index e3ef5f234ba..9bc9059efcc 100644 --- a/.github/workflows/scriptcheck.yml +++ b/.github/workflows/scriptcheck.yml @@ -58,6 +58,7 @@ jobs: steps: - uses: actions/checkout@v4 + # TODO: bailout on error - name: Restore Cppcheck uses: actions/cache@v4 with: diff --git a/CMakeLists.txt b/CMakeLists.txt index aeaff548fc9..94c7cc40318 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,6 +69,12 @@ if(LIBXML2_XMLLINT_EXECUTABLE) add_custom_target(validateRules ${LIBXML2_XMLLINT_EXECUTABLE} --noout ${CMAKE_SOURCE_DIR}/rules/*.xml) endif() +# TODO: add the following Makefile features: +# - "man/cppcheck.1" target +# - "tags" target +# - Cygwin handling +# - MinGW handling + if(BUILD_TESTS) enable_testing() endif() diff --git a/addons/naming.py b/addons/naming.py index 42a4237489e..2893779f2e0 100755 --- a/addons/naming.py +++ b/addons/naming.py @@ -37,6 +37,7 @@ def validate_regex(expr): elif arg[:11] == '--function=': RE_FUNCTIONNAME = arg[11:] validate_regex(RE_FUNCTIONNAME) + # TODO: bail out on unknown parameter def reportError(token, severity, msg, errorId): diff --git a/cli/cmdlineparser.cpp b/cli/cmdlineparser.cpp index f2baaf39713..af9925b5e41 100644 --- a/cli/cmdlineparser.cpp +++ b/cli/cmdlineparser.cpp @@ -1094,6 +1094,7 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a // --project-configuration else if (std::strncmp(argv[i], "--project-configuration=", 24) == 0) { mVSConfig = argv[i] + 24; + // TODO: provide error when this does nothing if (!mVSConfig.empty() && (project.projectType == ImportProject::Type::VS_SLN || project.projectType == ImportProject::Type::VS_VCXPROJ)) project.ignoreOtherConfigs(mVSConfig); } diff --git a/gui/projectfile.h b/gui/projectfile.h index 9647256195a..8b10220931d 100644 --- a/gui/projectfile.h +++ b/gui/projectfile.h @@ -224,6 +224,7 @@ class ProjectFile : public QObject { QStringList getAddonsAndTools() const; bool getClangAnalyzer() const { + // TODO return false; //mClangAnalyzer; } diff --git a/lib/check.cpp b/lib/check.cpp index c5e6368f1fc..12b42a82cab 100644 --- a/lib/check.cpp +++ b/lib/check.cpp @@ -63,6 +63,7 @@ void Check::writeToErrorList(const ErrorMessage &errmsg) void Check::reportError(const std::list &callstack, Severity severity, const std::string &id, const std::string &msg, const CWE &cwe, Certainty certainty) { + // TODO: report debug warning when error is for a disabled severity const ErrorMessage errmsg(callstack, mTokenizer ? &mTokenizer->list : nullptr, severity, id, msg, cwe, certainty); if (mErrorLogger) mErrorLogger->reportErr(errmsg); @@ -72,6 +73,7 @@ void Check::reportError(const std::list &callstack, Severity seve void Check::reportError(const ErrorPath &errorPath, Severity severity, const char id[], const std::string &msg, const CWE &cwe, Certainty certainty) { + // TODO: report debug warning when error is for a disabled severity const ErrorMessage errmsg(errorPath, mTokenizer ? &mTokenizer->list : nullptr, severity, id, msg, cwe, certainty); if (mErrorLogger) mErrorLogger->reportErr(errmsg); diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index dce67605121..8668db48a3f 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -493,14 +493,14 @@ unsigned int CppCheck::checkClang(const FileWithDetails &file) reportErr(errorMessage); }; if (reportClangErrors(fin, reportError, compilerWarnings)) - return 0; + return 0; // TODO: report as failure? } else { std::istringstream istr(output2); auto reportError = [this](const ErrorMessage& errorMessage) { reportErr(errorMessage); }; if (reportClangErrors(istr, reportError, compilerWarnings)) - return 0; + return 0; // TODO: report as failure? } if (!mSettings.buildDir.empty()) { @@ -1056,6 +1056,7 @@ void CppCheck::checkNormalTokens(const Tokenizer &tokenizer) CheckUnusedFunctions unusedFunctionsChecker; // TODO: this should actually be the behavior if only "--enable=unusedFunction" is specified - see #10648 + // TODO: log message when this is active? const char* unusedFunctionOnly = std::getenv("UNUSEDFUNCTION_ONLY"); const bool doUnusedFunctionOnly = unusedFunctionOnly && (std::strcmp(unusedFunctionOnly, "1") == 0); diff --git a/lib/path.cpp b/lib/path.cpp index 8b0b75c8ca0..ebe15e45649 100644 --- a/lib/path.cpp +++ b/lib/path.cpp @@ -61,6 +61,7 @@ static constexpr bool caseInsensitiveFilesystem() return true; #else // TODO: Non-windows filesystems might be case insensitive + // needs to be determined per filesystem and location - e.g. /sys/fs/ext4/features/casefold return false; #endif } diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index db4386d6401..dde0b7ddf7e 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -2320,7 +2320,6 @@ void Variable::evaluate(const Settings& settings) const Library & lib = settings.library; - // TODO: ValueType::parseDecl() is also performing a container lookup bool isContainer = false; if (mNameToken) setFlag(fIsArray, arrayDimensions(settings, isContainer)); diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index c00d98e47ac..59a11e0aa5c 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -1180,6 +1180,7 @@ void Tokenizer::simplifyTypedef() simplifyTypedefCpp(); } +// TODO: rename - it is not C++ specific void Tokenizer::simplifyTypedefCpp() { const bool cpp = isCPP(); @@ -3477,6 +3478,7 @@ bool Tokenizer::simplifyTokens1(const std::string &configuration) // TODO: apply this through Settings::ValueFlowOptions // TODO: do not run valueflow if no checks are being performed at all - e.g. unusedFunctions only + // TODO: log message when this is active? const char* disableValueflowEnv = std::getenv("DISABLE_VALUEFLOW"); const bool doValueFlow = !disableValueflowEnv || (std::strcmp(disableValueflowEnv, "1") != 0); diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index b5d928d28a9..1a5ac45b93d 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -5476,7 +5476,7 @@ void ValueFlow::setValues(TokenList& tokenlist, runner.run_once({ VFA(valueFlowDynamicBufferSize(tokenlist, symboldatabase, errorLogger, settings)), - VFA(analyzeDebug(tokenlist, errorLogger, settings)), + VFA(analyzeDebug(tokenlist, errorLogger, settings)), // TODO: add option to print it after each step/iteration }); } diff --git a/test/fixture.cpp b/test/fixture.cpp index f9414f0fd58..aaa891917d4 100644 --- a/test/fixture.cpp +++ b/test/fixture.cpp @@ -380,6 +380,7 @@ std::size_t TestFixture::runTests(const options& args) countTests = 0; errmsg.str(""); + // TODO: bail out when given class/test is not found? for (std::string classname : args.which_test()) { std::string testname; if (classname.find("::") != std::string::npos) { diff --git a/test/testmathlib.cpp b/test/testmathlib.cpp index e7e6d3b047a..016fc9e252c 100644 --- a/test/testmathlib.cpp +++ b/test/testmathlib.cpp @@ -690,6 +690,7 @@ class TestMathLib : public TestFixture { //ASSERT_THROW_INTERNAL_EQUALS(MathLib::toDoubleNumber("1.0LL"), INTERNAL, "Internal Error. MathLib::toDoubleNumber: input was not completely consumed: 1.0LL"); // verify: string --> double --> string conversion + // TODO: add L, min/max ASSERT_EQUALS("1.0", MathLib::toString(MathLib::toDoubleNumber("1.0f"))); ASSERT_EQUALS("1.0", MathLib::toString(MathLib::toDoubleNumber("1.0"))); ASSERT_EQUALS("0.0", MathLib::toString(MathLib::toDoubleNumber("0.0f"))); diff --git a/tools/donate-cpu-server.py b/tools/donate-cpu-server.py index b4929ad75ad..c041f38383e 100755 --- a/tools/donate-cpu-server.py +++ b/tools/donate-cpu-server.py @@ -28,6 +28,7 @@ # changes) SERVER_VERSION = "1.3.63" +# TODO: fetch from GitHub tags OLD_VERSION = '2.16.0' HEAD_MARKER = 'head results:'