Arkanjo 0.1
A tool for find code duplicated functions in codebases
Loading...
Searching...
No Matches
big_clone_tailor_evaluator.hpp
Go to the documentation of this file.
1
11
12#ifndef BIG_CLONE_TAILOR_EVALUATOR_HPP
13#define BIG_CLONE_TAILOR_EVALUATOR_HPP
14
15#include <bits/stdc++.h>
16
17#include "../base/path.hpp"
18#include "../base/utils.hpp"
20
21using namespace std;
22
30 private:
31 string CLONE_LABELS_FILE_PATH = "/home/luan/linux/test-duplication-code/parser/bigclonebench/clone_labels.txt";
32 string EXTENSION = ".java";
33 int NUMBER_OF_TYPES = 6;
34 int NOT_CLONE_TYPE_ID = 5;
35 string RECALL_PER_TYPE_PRINT = "Recall Value of each type";
36 double MINIMUM_SIMILARITY_TEMP = 0;
37
39 vector<string> ID_TO_TYPE_LABEL = {
40 "T1",
41 "T2",
42 "ST3",
43 "MT3",
44 "WT3/T4",
45 "Negative",
46 };
47
48 Similarity_Table *similarity_table;
49 map<pair<int,int>,int> id_pair_to_type;
50 vector<int> count_of_samples_by_type;
51
55 void read_clone_labels();
56
62 int path_to_id(Path path);
63
68 vector<tuple<double,int,int>> similar_path_pairs_formated_with_id();
69
76 bool is_relevant_pair(int id0, int id1);
77
83 set<pair<int,int>> filter_similar_id_pairs_only_relevant_ones(
84 vector<pair<int,int>> similar_id_pairs);
85
92 vector<pair<int,int>> filter_similar_path_pairs_by_similarity(
93 vector<tuple<double,int,int>> similar_id_pairs,
94 double minimum_similarity);
95
101 vector<int> build_frequency_corrected_guessed_by_type(
102 vector<pair<int,int>> similar_id_pairs);
103
110 double calc_recall(vector<int> frequency, int type);
111
116 void print_recall_per_type(vector<int> frequency);
117
122 void evaluate(double minimum_similarity);
123
124 public:
130};
131
132#endif
Big_Clone_Tailor_Evaluator(Similarity_Table *_similarity_table)
Constructs evaluator with similarity data.
Path manipulation class for tool-specific directory structure.
Definition path.hpp:24
Manages and analyzes function similarity relationships.
Path abstraction for temporary codebase.
Similarity relationships storage and analysis.
Defines utility functions used across all files.