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

Method getUseRetValType

lib/library.cpp:1638–1656  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1636}
1637
1638Library::UseRetValType Library::getUseRetValType(const Token *ftok) const
1639{
1640 if (isNotLibraryFunction(ftok)) {
1641 if (Token::simpleMatch(ftok->astParent(), ".")) {
1642 const Token* contTok = ftok->astParent()->astOperand1();
1643 using Yield = Library::Container::Yield;
1644 const Yield yield = astContainerYield(contTok, *this);
1645 if (yield == Yield::START_ITERATOR || yield == Yield::END_ITERATOR || yield == Yield::AT_INDEX ||
1646 yield == Yield::SIZE || yield == Yield::EMPTY || yield == Yield::BUFFER || yield == Yield::BUFFER_NT ||
1647 ((yield == Yield::ITEM || yield == Yield::ITERATOR) && astContainerAction(contTok, *this) == Library::Container::Action::NO_ACTION))
1648 return Library::UseRetValType::DEFAULT;
1649 }
1650 return Library::UseRetValType::NONE;
1651 }
1652 const auto it = utils::as_const(mData->mFunctions).find(getFunctionName(ftok));
1653 if (it != mData->mFunctions.cend())
1654 return it->second.useretval;
1655 return Library::UseRetValType::NONE;
1656}
1657
1658const std::string& Library::returnValue(const Token *ftok) const
1659{

Callers 1

Calls 6

astContainerYieldFunction · 0.85
astContainerActionFunction · 0.85
astParentMethod · 0.80
astOperand1Method · 0.80
simpleMatchFunction · 0.70
findMethod · 0.45

Tested by

no test coverage detected