Moved function from .h to .cpp
This commit is contained in:
parent
077e652de4
commit
8218120fd5
|
@ -75,3 +75,21 @@ std::string Check::getMessageId(const ValueFlow::Value &value, const char id[])
|
|||
return std::string("safe") + (char)std::toupper(id[0]) + (id + 1);
|
||||
return id;
|
||||
}
|
||||
|
||||
ErrorPath Check::getErrorPath(const Token* errtok, const ValueFlow::Value* value, const std::string& bug) const
|
||||
{
|
||||
ErrorPath errorPath;
|
||||
if (!value) {
|
||||
errorPath.emplace_back(errtok, bug);
|
||||
} else if (mSettings->verbose || mSettings->xml || !mSettings->templateLocation.empty()) {
|
||||
errorPath = value->errorPath;
|
||||
errorPath.emplace_back(errtok, bug);
|
||||
} else {
|
||||
if (value->condition)
|
||||
errorPath.emplace_back(value->condition, "condition '" + value->condition->expressionString() + "'");
|
||||
//else if (!value->isKnown() || value->defaultArg)
|
||||
// errorPath = value->callstack;
|
||||
errorPath.emplace_back(errtok, bug);
|
||||
}
|
||||
return errorPath;
|
||||
}
|
17
lib/check.h
17
lib/check.h
|
@ -162,22 +162,7 @@ protected:
|
|||
reportError(errmsg);
|
||||
}
|
||||
|
||||
ErrorPath getErrorPath(const Token *errtok, const ValueFlow::Value *value, const std::string &bug) const {
|
||||
ErrorPath errorPath;
|
||||
if (!value) {
|
||||
errorPath.emplace_back(errtok,bug);
|
||||
} else if (mSettings->verbose || mSettings->xml || !mSettings->templateLocation.empty()) {
|
||||
errorPath = value->errorPath;
|
||||
errorPath.emplace_back(errtok,bug);
|
||||
} else {
|
||||
if (value->condition)
|
||||
errorPath.emplace_back(value->condition, "condition '" + value->condition->expressionString() + "'");
|
||||
//else if (!value->isKnown() || value->defaultArg)
|
||||
// errorPath = value->callstack;
|
||||
errorPath.emplace_back(errtok,bug);
|
||||
}
|
||||
return errorPath;
|
||||
}
|
||||
ErrorPath getErrorPath(const Token* errtok, const ValueFlow::Value* value, const std::string& bug) const;
|
||||
|
||||
/**
|
||||
* Use WRONG_DATA in checkers when you check for wrong data. That
|
||||
|
|
Loading…
Reference in New Issue