ArKanjo 0.5.1
A tool for find code duplicated functions in codebases
similarity_explorer_entry.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4#include <nlohmann/json.hpp>
5
7
9 std::string path_a;
10 std::string path_b;
11 std::string dir_a;
12 std::string dir_b;
13 std::string filename_a;
14 std::string filename_b;
15 std::string func_a;
16 std::string func_b;
17 uint32_t start_a;
18 uint32_t start_b;
19 uint32_t end_a;
20 uint32_t end_b;
21 uint32_t duplicated_lines{0};
22 double similarity;
23};
24
25inline void to_json(json& j, const SimilarityExplorerEntry& d) {
26 j = {
27 {"path_a", d.path_a},
28 {"path_b", d.path_b},
29 {"dir_a", d.dir_a},
30 {"dir_b", d.dir_b},
31 {"filename_a", d.filename_a},
32 {"filename_b", d.filename_b},
33 {"func_a", d.func_a},
34 {"func_b", d.func_b},
35 {"start_a", d.start_a},
36 {"start_b", d.start_b},
37 {"end_a", d.end_a},
38 {"end_b", d.end_b},
39 {"duplicated_lines", d.duplicated_lines},
40 {"similarity", d.similarity},
41 };
42}
43
44typedef struct {
45 int found;
46 int show;
48
50 j = {
51 {"found", d.found},
52 {"show", d.show},
53 };
54}
nlohmann::json json
void to_json(json &j, const SimilarityExplorerEntry &d)
nlohmann::json json