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

Method unusedVariableError

lib/checkunusedvar.cpp:1482–1488  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1480}
1481
1482void CheckUnusedVarImpl::unusedVariableError(const Token *tok, const std::string &varname)
1483{
1484 if (!mSettings.severity.isEnabled(Severity::style) && !mSettings.isPremiumEnabled("unusedVariable"))
1485 return;
1486
1487 reportError(tok, Severity::style, "unusedVariable", "$symbol:" + varname + "\nUnused variable: $symbol", CWE563, Certainty::normal);
1488}
1489
1490void CheckUnusedVarImpl::allocatedButUnusedVariableError(const Token *tok, const std::string &varname)
1491{

Callers 1

getErrorMessagesMethod · 0.80

Calls 3

isPremiumEnabledMethod · 0.80
reportErrorFunction · 0.70
isEnabledMethod · 0.45

Tested by

no test coverage detected