Arkanjo 0.1
A tool for find code duplicated functions in codebases
Loading...
Searching...
No Matches
preprocessor.hpp
Go to the documentation of this file.
1
12
13#ifndef PREPROCESSOR_HPP
14#define PREPROCESSOR_HPP
15
16#include <bits/stdc++.h>
17#include "parser.hpp"
18#include "function_breaker.hpp"
19#include "../base/config.hpp"
22using namespace std;
23
36 private:
37 // User interaction messages
38 string PROJECT_PATH_MESSAGE = "Enter your project path:";
39 string MINIMUM_SIMILARITY_MESSAGE = "Enter minimum similarity desired on using the tool:";
40 string CONFIG_PATH = "config.txt";
41 string PATH_MESSAGE = "path of the current preprocess: ";
42 string TIME_MESSAGE = "Finished time: ";
43
44 // Processing stage messages
45 string INITIAL_MESSAGE = "Initiating Preprocessing";
46 string BREAKER_MESSAGE = "Reading codebase... (this may take a while)";
47 string DUPLICATION_MESSAGE = "Finding duplication in the codebase... (this may take a while)";
48 string SAVING_MESSAGE = "Saving results...";
49 string END_MESSAGE = "Finished preprocessing";
50
51 // Duplication finder selection messages
52 string MESSAGE_DUPLICATION_FINDER_TYPE_1 = "Enter the number of the duplication finder technique you want to use:";
53 string MESSAGE_DUPLICATION_FINDER_TYPE_2 = "1) NLP text similarity using gensim";
54 string MESSAGE_DUPLICATION_FINDER_TYPE_3 = "2) Count proportion of equal lines using diff command";
55 string INVALID_CODE_DUPLICATION_FINDER = "Valid options are '1' or '2' only. Stopping Program...";
56
64 tuple<string,double,bool> read_parameters();
65
70 void save_current_run_params(string path);
71
78 void preprocess(string path, double similarity, bool use_duplication_finder_by_tool);
79
80 public:
85 Preprocessor(bool force_preprocess);
86
94 Preprocessor(bool force_preprocess, string path, double similarity);
95};
96
97#endif
Preprocessor(bool force_preprocess)
Constructs preprocessor with optional forcing.
Configuration management interface.
Code duplication preprocessing system.
Main duplication detection tool interface.
Main function extraction interface.
Code duplication results parser.