| 1496 | } |
| 1497 | |
| 1498 | void CheckUnusedVarImpl::unreadVariableError(const Token *tok, const std::string &varname, bool modified) |
| 1499 | { |
| 1500 | if (!mSettings.severity.isEnabled(Severity::style) && !mSettings.isPremiumEnabled("unusedVariable")) |
| 1501 | return; |
| 1502 | |
| 1503 | if (modified) |
| 1504 | reportError(tok, Severity::style, "unreadVariable", "$symbol:" + varname + "\nVariable '$symbol' is modified but its new value is never used.", CWE563, Certainty::normal); |
| 1505 | else |
| 1506 | reportError(tok, Severity::style, "unreadVariable", "$symbol:" + varname + "\nVariable '$symbol' is assigned a value that is never used.", CWE563, Certainty::normal); |
| 1507 | } |
| 1508 | |
| 1509 | void CheckUnusedVarImpl::unassignedVariableError(const Token *tok, const std::string &varname) |
| 1510 | { |
no test coverage detected