Arkanjo 0.1
A tool for find code duplicated functions in codebases
Loading...
Searching...
No Matches
function_breaker_java.hpp
Go to the documentation of this file.
1
10
11#ifndef FUNCTION_BREAKER_JAVA_HPP
12#define FUNCTION_BREAKER_JAVA_HPP
13
14#include <bits/stdc++.h>
15#include "../base/utils.hpp"
17
26 const int NUMBER_OF_LINES_BEFORE_FOR_FUNCTION_NAME = 7;
27 const int C_RELEVANT_DEPTH = 0;
28 const int JAVA_RELEVANT_DEPTH = 1;
29 const bool IGNORE_EMPTY_FUNCTIONS = true;
30 const bool ALLOW_STRUCTS = false;
31
37 set<array<int,3>> find_start_end_and_depth_of_brackets(vector<string> brackets_content);
38
45 set<pair<int,int>> find_start_end_of_brackets_of_given_depth(vector<string> brackets_content, int depth);
46
52 int find_position_first_open_bracket(string s);
53
59 string extract_last_token_of_string(string s);
60
67 Line_content build_line_code(int line_number, string content);
68
76 vector<Line_content> get_lines_before_body_function(const vector<string> &file_content, int line_start_body_function, int pos_bracket);
77
83 vector<Line_content> remove_parenteses_at_the_end_of_the_scope(vector<Line_content> code);
84
90 vector<Line_content> remove_content_until_find_parenteses_at_the_end(vector<Line_content> code);
91
97 vector<Line_content> remove_parameters_of_declaration_c(vector<Line_content> code);
98
104 vector<Line_content> remove_parameters_of_declaration_java(vector<Line_content> code);
105
112 vector<Line_content> remove_parameters_of_declaration(vector<Line_content> code, PROGRAMMING_LANGUAGE programming_language);
113
121 pair<string,int> extract_function_name_and_line_from_declaration(const vector<string> &file_content, int line_start_body_function, PROGRAMMING_LANGUAGE programming_language);
122
130 vector<string> build_function_content(int start_number_line, int end_number_line, const vector<string> &file_content);
131
141 vector<string> build_header_content(int start_number_line, int line_declaration, string relative_path, string function_name, const vector<string> &file_content);
142
150 bool is_body_function_empty(int start_number_line, int end_number_line, const vector<string> &file_content);
151
160 void process_function(int start_number_line, int end_number_line, string relative_path, const vector<string> &file_content, PROGRAMMING_LANGUAGE programming_language);
161
168 string file_path_from_folder_path(string file_path, string folder_path);
169
175 void file_breaker_java(string file_path, string folder_path);
176
177 public:
183 FunctionBreakerJava(string file_path, string folder_path);
184};
185
186#endif
FunctionBreakerJava(string file_path, string folder_path)
Constructs Java function breaker and processes file.
Function breaker utilities and constants.
PROGRAMMING_LANGUAGE
Enumeration of supported programming languages.
Structure representing a line of source code.
Defines utility functions used across all files.