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

Method unassignedVariableError

lib/checkunusedvar.cpp:1509–1515  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1507}
1508
1509void CheckUnusedVarImpl::unassignedVariableError(const Token *tok, const std::string &varname)
1510{
1511 if (!mSettings.severity.isEnabled(Severity::style) && !mSettings.isPremiumEnabled("unusedVariable"))
1512 return;
1513
1514 reportError(tok, Severity::style, "unassignedVariable", "$symbol:" + varname + "\nVariable '$symbol' is not assigned a value.", CWE665, Certainty::normal);
1515}
1516
1517//---------------------------------------------------------------------------
1518// Check that all struct members are used

Callers 1

getErrorMessagesMethod · 0.80

Calls 3

isPremiumEnabledMethod · 0.80
reportErrorFunction · 0.70
isEnabledMethod · 0.45

Tested by

no test coverage detected