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

Method checkPlistOutput

lib/cppcheck.cpp:900–913  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

898}
899
900void CppCheck::checkPlistOutput(const FileWithDetails& file, const std::vector<std::string>& files)
901{
902 if (!mSettings.plistOutput.empty()) {
903 const bool slashFound = file.spath().find('/') != std::string::npos;
904 std::string filename = slashFound ? file.spath().substr(file.spath().rfind('/') + 1) : file.spath();
905 // removes suffix from filename when it exists
906 const std::string noSuffixFilename = filename.substr(0, filename.find('.'));
907
908 // the hash is added to handle when files in different folders have the same name
909 const std::size_t fileNameHash = std::hash<std::string> {}(file.spath());
910 filename = mSettings.plistOutput + noSuffixFilename + "_" + std::to_string(fileNameHash) + ".plist";
911 mLogger->openPlist(filename, files);
912 }
913}
914
915unsigned int CppCheck::checkInternal(const FileWithDetails& file, const std::string &cfgname, const CreateTokenListFn& createTokenList)
916{

Callers

nothing calls this directly

Calls 3

openPlistMethod · 0.80
emptyMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected