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

Method duplicateConditionError

lib/checkcondition.cpp:518–528  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

516}
517
518void CheckConditionImpl::duplicateConditionError(const Token *tok1, const Token *tok2, ErrorPath errorPath)
519{
520 if (diag(tok1, tok2))
521 return;
522 errorPath.emplace_back(tok1, "First condition");
523 errorPath.emplace_back(tok2, "Second condition");
524
525 std::string msg = "The if condition is the same as the previous if condition";
526
527 reportError(std::move(errorPath), Severity::style, "duplicateCondition", msg, CWE398, Certainty::normal);
528}
529
530void CheckConditionImpl::multiCondition()
531{

Callers 1

getErrorMessagesMethod · 0.80

Calls 2

diagFunction · 0.70
reportErrorFunction · 0.70

Tested by

no test coverage detected