11 base_path = base_path_;
12 similarity = similarity_;
16 fs::path output_parsed = base_path /
"output_parsed.txt";
17 if (!feature_name.empty())
18 fs::path output_parsed = base_path / (
"output_parsed" + feature_name +
".txt");
20 fs::path cwd = fs::current_path();
21 fs::current_path(folder_path);
23 std::string command_tool =
"python3 -W ignore ";
25 command_tool +=
"/duplicate-code-detection-tool/duplicate_code_detection.py";
26 command_tool +=
" --project-root-dir ";
27 command_tool += folder_path;
28 command_tool +=
" -d ";
29 command_tool += folder_path;
33 FILE* pipe = popen(command_tool.c_str(),
"r");
35 std::cerr <<
"Error executing the tool.\n";
39 Parser parser(output_parsed, similarity);
42 fs::current_path(cwd);
53 fs::path relative(fd.
path);
54 std::string filename = fd.
function_name + relative.extension().string();
55 fs::path path = base / relative / filename;
static Config & config()
Gets the singleton configuration instance.
fs::path third_party_dir
Directory containing third-party dependencies.
std::string function_name
Name of the function.
std::shared_ptr< T > get_feature() const
Parses and transforms duplication detection tool output.
void exec_from_stream(FILE *pipe)
Main parsing execution method using stream.
Configuration management interface.
void write_file(const fs::path &path, const std::string &content)
Writes content to a file at specified path.
fs::path source_feature_path