3string BigCloneFormater::format_relative_path(
string relative_path) {
4 for (
auto& c : relative_path) {
12string BigCloneFormater::build_path_formated_string(
Path path) {
14 relative_path = format_relative_path(relative_path);
18 auto [line_declaration, start_line, end_line] = function.get_scope_function_in_file();
22 ret +=
',' + to_string(line_declaration);
23 ret +=
',' + to_string(start_line);
24 ret +=
',' + to_string(end_line);
28auto BigCloneFormater::process_similar_path_pair(
Path path1,
Path path2,
double similarity) {
29 auto string_path1 = build_path_formated_string(path1);
30 auto string_path2 = build_path_formated_string(path2);
32 string comparation_string = string_path1 +
',' + string_path2 +
',';
33 cout << comparation_string;
34 cout << fixed << setprecision(2) << similarity <<
'\n';
38 similarity_table = _similarity_table;
47 for (
auto [similarity, path1, path2] : similar_paths) {
48 process_similar_path_pair(path1, path2, similarity);
Represents a code function with its content and metadata.
Path manipulation class for tool-specific directory structure.
std::string build_relative_path() const
Builds relative path portion.
Represents a similarity graph between functions (paths).
std::vector< std::tuple< double, Path, Path > > get_all_path_pairs_and_similarity_sorted_by_similarity()
Gets all similar path pairs with scores, sorted.