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

Method loadUnsafeUsageListFromXml

lib/ctu.cpp:261–281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259}
260
261std::list<CTU::FileInfo::UnsafeUsage> CTU::loadUnsafeUsageListFromXml(const tinyxml2::XMLElement *xmlElement)
262{
263 std::list<CTU::FileInfo::UnsafeUsage> ret;
264 for (const tinyxml2::XMLElement *e = xmlElement->FirstChildElement(); e; e = e->NextSiblingElement()) {
265 if (std::strcmp(e->Name(), "unsafe-usage") != 0)
266 continue;
267 bool error = false;
268 FileInfo::UnsafeUsage unsafeUsage;
269 unsafeUsage.myId = readAttrString(e, ATTR_MY_ID, &error);
270 unsafeUsage.myArgNr = readAttrInt(e, ATTR_MY_ARGNR, &error);
271 unsafeUsage.myArgumentName = readAttrString(e, ATTR_MY_ARGNAME, &error);
272 unsafeUsage.location.fileName = readAttrString(e, ATTR_LOC_FILENAME, &error);
273 unsafeUsage.location.lineNumber = readAttrInt(e, ATTR_LOC_LINENR, &error);
274 unsafeUsage.location.column = readAttrInt(e, ATTR_LOC_COLUMN, &error);
275 unsafeUsage.value = readAttrInt(e, ATTR_VALUE, &error);
276
277 if (!error)
278 ret.push_back(std::move(unsafeUsage));
279 }
280 return ret;
281}
282
283static int isCallFunction(const Scope *scope, int argnr, const Token *&tok)
284{

Callers

nothing calls this directly

Calls 6

readAttrStringFunction · 0.85
readAttrIntFunction · 0.85
FirstChildElementMethod · 0.80
NextSiblingElementMethod · 0.80
NameMethod · 0.80
push_backMethod · 0.45

Tested by

no test coverage detected