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

Function valueFlowDebug

lib/valueflow.cpp:7175–7192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7173}
7174
7175static void valueFlowDebug(TokenList& tokenlist, ErrorLogger& errorLogger, const Settings& settings)
7176{
7177 if (!settings.debugnormal && !settings.debugwarnings)
7178 return;
7179 for (Token* tok = tokenlist.front(); tok; tok = tok->next()) {
7180 if (tok->getTokenDebug() != TokenDebug::ValueFlow)
7181 continue;
7182 if (tok->astParent() && tok->astParent()->getTokenDebug() == TokenDebug::ValueFlow)
7183 continue;
7184 for (const ValueFlow::Value& v : tok->values()) {
7185 std::string msg = "The value is " + debugString(v);
7186 ErrorPath errorPath = v.errorPath;
7187 errorPath.insert(errorPath.end(), v.debugPath.cbegin(), v.debugPath.cend());
7188 errorPath.emplace_back(tok, "");
7189 errorLogger.reportErr({std::move(errorPath), &tokenlist, Severity::debug, "valueFlow", msg, CWE{0}, Certainty::normal});
7190 }
7191 }
7192}
7193
7194const ValueFlow::Value *ValueFlow::valueFlowConstantFoldAST(Token *expr, const Settings &settings)
7195{

Callers 1

setValuesMethod · 0.85

Calls 6

debugStringFunction · 0.85
frontMethod · 0.80
nextMethod · 0.80
astParentMethod · 0.80
endMethod · 0.45
reportErrMethod · 0.45

Tested by

no test coverage detected