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#ifndef BIG_CLONE_TAILOR_EVALUATOR_HPP
12#define BIG_CLONE_TAILOR_EVALUATOR_HPP
13
14#include <string>
15#include <vector>
16#include <map>
17#include <set>
18#include <tuple>
19#include <iostream>
20#include <iomanip>
21#include <cassert>
22
23#include "../base/path.hpp"
24#include "../base/utils.hpp"
26
27using namespace std;
28
36 private:
37 string CLONE_LABELS_FILE_PATH = "/home/luan/linux/test-duplication-code/parser/bigclonebench/clone_labels.txt";
38 string EXTENSION = ".java";
39 int NUMBER_OF_TYPES = 6;
40 int NOT_CLONE_TYPE_ID = 5;
41 string RECALL_PER_TYPE_PRINT = "Recall Value of each type";
42 double MINIMUM_SIMILARITY_TEMP = 0;
43
45 vector<string> ID_TO_TYPE_LABEL = {
46 "T1",
47 "T2",
48 "ST3",
49 "MT3",
50 "WT3/T4",
51 "Negative",
52 };
53
54 Similarity_Table *similarity_table;
55 map<pair<int,int>,int> id_pair_to_type;
56 vector<int> count_of_samples_by_type;
57
61 void read_clone_labels();
62
68 int path_to_id(Path path);
69
74 vector<tuple<double,int,int>> similar_path_pairs_formated_with_id();
75
82 bool is_relevant_pair(int id0, int id1);
83
89 set<pair<int,int>> filter_similar_id_pairs_only_relevant_ones(
90 vector<pair<int,int>> similar_id_pairs);
91
98 vector<pair<int,int>> filter_similar_path_pairs_by_similarity(
99 vector<tuple<double,int,int>> similar_id_pairs,
100 double minimum_similarity);
101
107 vector<int> build_frequency_corrected_guessed_by_type(
108 vector<pair<int,int>> similar_id_pairs);
109
116 double calc_recall(vector<int> frequency, int type);
117
122 void print_recall_per_type(vector<int> frequency);
123
128 void evaluate(double minimum_similarity);
129
130 public:
136};
137
138#endif
Evaluates clone detection using BigCloneBench methodology.
Big_Clone_Tailor_Evaluator(Similarity_Table *_similarity_table)
Constructs evaluator with similarity data.
Path manipulation class for tool-specific directory structure.
Definition path.hpp:27
Manages and analyzes function similarity relationships.
Definition json.hpp:5678
Path abstraction for temporary codebase.
Similarity relationships storage and analysis.
Defines utility functions used across all files.