Skip to content

Commit 0cf639c

Browse files
authored
added various TODOs [skip ci] (danmar#6897)
1 parent 4604b6e commit 0cf639c

File tree

14 files changed

+22
-4
lines changed

14 files changed

+22
-4
lines changed

.github/workflows/scriptcheck.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ jobs:
5858
steps:
5959
- uses: actions/checkout@v4
6060

61+
# TODO: bailout on error
6162
- name: Restore Cppcheck
6263
uses: actions/cache@v4
6364
with:

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ if(LIBXML2_XMLLINT_EXECUTABLE)
6969
add_custom_target(validateRules ${LIBXML2_XMLLINT_EXECUTABLE} --noout ${CMAKE_SOURCE_DIR}/rules/*.xml)
7070
endif()
7171

72+
# TODO: add the following Makefile features:
73+
# - "man/cppcheck.1" target
74+
# - "tags" target
75+
# - Cygwin handling
76+
# - MinGW handling
77+
7278
if(BUILD_TESTS)
7379
enable_testing()
7480
endif()

addons/naming.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def validate_regex(expr):
3737
elif arg[:11] == '--function=':
3838
RE_FUNCTIONNAME = arg[11:]
3939
validate_regex(RE_FUNCTIONNAME)
40+
# TODO: bail out on unknown parameter
4041

4142

4243
def reportError(token, severity, msg, errorId):

cli/cmdlineparser.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,6 +1094,7 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
10941094
// --project-configuration
10951095
else if (std::strncmp(argv[i], "--project-configuration=", 24) == 0) {
10961096
mVSConfig = argv[i] + 24;
1097+
// TODO: provide error when this does nothing
10971098
if (!mVSConfig.empty() && (project.projectType == ImportProject::Type::VS_SLN || project.projectType == ImportProject::Type::VS_VCXPROJ))
10981099
project.ignoreOtherConfigs(mVSConfig);
10991100
}

gui/projectfile.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ class ProjectFile : public QObject {
224224
QStringList getAddonsAndTools() const;
225225

226226
bool getClangAnalyzer() const {
227+
// TODO
227228
return false; //mClangAnalyzer;
228229
}
229230

lib/check.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ void Check::writeToErrorList(const ErrorMessage &errmsg)
6363

6464
void Check::reportError(const std::list<const Token *> &callstack, Severity severity, const std::string &id, const std::string &msg, const CWE &cwe, Certainty certainty)
6565
{
66+
// TODO: report debug warning when error is for a disabled severity
6667
const ErrorMessage errmsg(callstack, mTokenizer ? &mTokenizer->list : nullptr, severity, id, msg, cwe, certainty);
6768
if (mErrorLogger)
6869
mErrorLogger->reportErr(errmsg);
@@ -72,6 +73,7 @@ void Check::reportError(const std::list<const Token *> &callstack, Severity seve
7273

7374
void Check::reportError(const ErrorPath &errorPath, Severity severity, const char id[], const std::string &msg, const CWE &cwe, Certainty certainty)
7475
{
76+
// TODO: report debug warning when error is for a disabled severity
7577
const ErrorMessage errmsg(errorPath, mTokenizer ? &mTokenizer->list : nullptr, severity, id, msg, cwe, certainty);
7678
if (mErrorLogger)
7779
mErrorLogger->reportErr(errmsg);

lib/cppcheck.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,14 +493,14 @@ unsigned int CppCheck::checkClang(const FileWithDetails &file)
493493
reportErr(errorMessage);
494494
};
495495
if (reportClangErrors(fin, reportError, compilerWarnings))
496-
return 0;
496+
return 0; // TODO: report as failure?
497497
} else {
498498
std::istringstream istr(output2);
499499
auto reportError = [this](const ErrorMessage& errorMessage) {
500500
reportErr(errorMessage);
501501
};
502502
if (reportClangErrors(istr, reportError, compilerWarnings))
503-
return 0;
503+
return 0; // TODO: report as failure?
504504
}
505505

506506
if (!mSettings.buildDir.empty()) {
@@ -1056,6 +1056,7 @@ void CppCheck::checkNormalTokens(const Tokenizer &tokenizer)
10561056
CheckUnusedFunctions unusedFunctionsChecker;
10571057

10581058
// TODO: this should actually be the behavior if only "--enable=unusedFunction" is specified - see #10648
1059+
// TODO: log message when this is active?
10591060
const char* unusedFunctionOnly = std::getenv("UNUSEDFUNCTION_ONLY");
10601061
const bool doUnusedFunctionOnly = unusedFunctionOnly && (std::strcmp(unusedFunctionOnly, "1") == 0);
10611062

lib/path.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ static constexpr bool caseInsensitiveFilesystem()
6161
return true;
6262
#else
6363
// TODO: Non-windows filesystems might be case insensitive
64+
// needs to be determined per filesystem and location - e.g. /sys/fs/ext4/features/casefold
6465
return false;
6566
#endif
6667
}

lib/symboldatabase.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2320,7 +2320,6 @@ void Variable::evaluate(const Settings& settings)
23202320

23212321
const Library & lib = settings.library;
23222322

2323-
// TODO: ValueType::parseDecl() is also performing a container lookup
23242323
bool isContainer = false;
23252324
if (mNameToken)
23262325
setFlag(fIsArray, arrayDimensions(settings, isContainer));

lib/tokenize.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,6 +1180,7 @@ void Tokenizer::simplifyTypedef()
11801180
simplifyTypedefCpp();
11811181
}
11821182

1183+
// TODO: rename - it is not C++ specific
11831184
void Tokenizer::simplifyTypedefCpp()
11841185
{
11851186
const bool cpp = isCPP();
@@ -3477,6 +3478,7 @@ bool Tokenizer::simplifyTokens1(const std::string &configuration)
34773478

34783479
// TODO: apply this through Settings::ValueFlowOptions
34793480
// TODO: do not run valueflow if no checks are being performed at all - e.g. unusedFunctions only
3481+
// TODO: log message when this is active?
34803482
const char* disableValueflowEnv = std::getenv("DISABLE_VALUEFLOW");
34813483
const bool doValueFlow = !disableValueflowEnv || (std::strcmp(disableValueflowEnv, "1") != 0);
34823484

0 commit comments

Comments
 (0)