Skip to content

Commit 5f7c1a9

Browse files
authored
Merge pull request #4 from olezhabobrov/olezhabobrov/slawa4s/sarif_generation
Delete useless code
2 parents 11a219e + fbbc467 commit 5f7c1a9

File tree

1 file changed

+0
-52
lines changed

1 file changed

+0
-52
lines changed

server/src/sarif/FileSarif.cpp

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -7,58 +7,6 @@
77

88
namespace sarif {
99

10-
namespace {
11-
[[nodiscard]] fs::path getUtbotDir() {
12-
return fs::current_path().parent_path().parent_path();
13-
}
14-
15-
[[nodiscard]] fs::path getKleeDir() {
16-
fs::path utbotDir = getUtbotDir();
17-
fs::path kleeDir = utbotDir / "submodules" / "klee";
18-
if (!fs::exists(kleeDir)) {
19-
LOG_S(ERROR) << "Klee directory is not " << kleeDir;
20-
return "/";
21-
}
22-
return kleeDir;
23-
}
24-
25-
[[nodiscard]] fs::path getKleeRuntimeDir() {
26-
return getKleeDir() / "runtime";
27-
}
28-
29-
[[nodiscard]] bool inKleeRuntimeDir(const fs::path &path) {
30-
if (fs::exists(path)) {
31-
return Paths::isSubPathOf(getKleeRuntimeDir(), path);
32-
}
33-
if (StringUtils::startsWith(path.c_str(), "runtime")) {
34-
fs::path absPath = getKleeRuntimeDir().parent_path() / path;
35-
return fs::exists(absPath);
36-
} else {
37-
return false;
38-
}
39-
}
40-
41-
[[nodiscard]] bool inKleeTmpDir(const fs::path &path) {
42-
return fs::exists(Paths::tmpPath / path);
43-
}
44-
45-
[[nodiscard]] std::optional<fs::path> isRelevant(const fs::path &path) {
46-
if (inKleeTmpDir(path)) {
47-
return std::nullopt;
48-
}
49-
if (inKleeRuntimeDir(path)) {
50-
fs::path relativePath = fs::relative(getKleeRuntimeDir().parent_path() / path,
51-
getKleeRuntimeDir());
52-
bool b = (relativePath.string().find("lib") != std::string::npos);
53-
if (b) {
54-
return getKleeRuntimeDir().parent_path() / path;
55-
}
56-
return std::nullopt;
57-
}
58-
return path;
59-
}
60-
}
61-
6210
FileSarif::FileSarif(const tests::Tests &tests, bool writeFlag) : ProjectSarif(tests.sourceFileNameNoExt,
6311
tests.relativeFileDir, writeFlag),
6412
sourcePath(tests.sourceFilePath) {}

0 commit comments

Comments
 (0)