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

Method getValueTokenMaxStrLength

lib/token.cpp:2001–2017  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1999}
2000
2001const Token *Token::getValueTokenMaxStrLength() const
2002{
2003 if (!mImpl->mValues)
2004 return nullptr;
2005 const Token *ret = nullptr;
2006 int maxlength = 0;
2007 for (auto it = mImpl->mValues->cbegin(); it != mImpl->mValues->end(); ++it) {
2008 if (it->isTokValue() && it->tokvalue && it->tokvalue->tokType() == Token::eString) {
2009 const int length = getStrLength(it->tokvalue);
2010 if (!ret || length > maxlength) {
2011 maxlength = length;
2012 ret = it->tokvalue;
2013 }
2014 }
2015 }
2016 return ret;
2017}
2018
2019static bool isAdjacent(const ValueFlow::Value& x, const ValueFlow::Value& y)
2020{

Callers 2

checkBufferSizeFunction · 0.80

Calls 1

endMethod · 0.45

Tested by

no test coverage detected