Arkanjo 0.2
A tool for find code duplicated functions in codebases
Loading...
Searching...
No Matches
counter_duplication_code.hpp
Go to the documentation of this file.
1
13#pragma once
14
16#include <arkanjo/base/path.hpp>
19#include <set>
20
22
30class CounterDuplicationCode : public CommandBase<CounterDuplicationCode> {
31 private:
32 std::set<Path> processed_paths;
33 CounterDuplicationCodeTrie counter_duplication_code_trie;
34 Similarity_Table* similarity_table;
35
40 void mark_path_as_processed(Path path);
41
47 bool is_path_processed_path(Path path);
48
54 static int get_number_of_lines_in_path(const Path& path);
55
62 void register_code_duplication(const Path& path1, const Path& path2, int number_of_lines);
63
68 void process_path(const Path& path);
69
73 void process_every_path_in_similarity_table();
74
75 public:
77 "Analyze and report duplicated lines across the codebase, grouped by "
78 "folder hierarchy. The command processes all detected duplications and "
79 "displays the total number of duplicated lines per directory.")
80
81
85 explicit CounterDuplicationCode(Similarity_Table* _similarity_table);
86
87 bool validate(const ParsedOptions& options) override;
88
92 bool run(const ParsedOptions& options) override;
93};
const CliOption * options() const final
Trie structure for hierarchical duplication counting.
Code duplication analyzer and reporter.
COMMAND_DESCRIPTION("Analyze and report duplicated lines across the codebase, grouped by " "folder hierarchy. The command processes all detected duplications and " "displays the total number of duplicated lines per directory.") explicit CounterDuplicationCode(Similarity_Table *_similarity_table)
Constructs analyzer with similarity data.
bool validate(const ParsedOptions &options) override
Validate the arguments already analyzed.
bool run(const ParsedOptions &options) override
Handles duplication analysis command.
Path manipulation class for tool-specific directory structure.
Definition path.hpp:27
Represents a similarity graph between functions (paths).
Trie-based code duplication counter.
Function abstraction for temporary codebase.
Path abstraction for temporary codebase.
Similarity relationships storage and analysis.