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

Method getAnalyzerInfoFile

lib/analyzerinfo.cpp:142–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142std::string AnalyzerInformation::getAnalyzerInfoFile(const std::string &buildDir, const std::string &sourcefile, const std::string &cfg, std::size_t fsFileId)
143{
144 std::ifstream fin(Path::join(buildDir, "files.txt"));
145 if (fin.is_open()) {
146 const std::string& ret = getAnalyzerInfoFileFromFilesTxt(fin, sourcefile, cfg, fsFileId);
147 if (!ret.empty())
148 return Path::join(buildDir, ret);
149 }
150
151 const std::string::size_type pos = sourcefile.rfind('/');
152 std::string filename;
153 if (pos == std::string::npos)
154 filename = sourcefile;
155 else
156 filename = sourcefile.substr(pos + 1);
157 // TODO: is this correct? the above code will return files ending in '.aN'. Also does not consider the ID
158 return Path::join(buildDir, std::move(filename)) + ".analyzerinfo";
159}
160
161bool AnalyzerInformation::analyzeFile(const std::string &buildDir, const std::string &sourcefile, const std::string &cfg, std::size_t fsFileId, std::size_t hash, std::list<ErrorMessage> &errors, bool debug)
162{

Callers

nothing calls this directly

Calls 2

joinFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected