Arkanjo 0.2
A tool for find code duplicated functions in codebases
Loading...
Searching...
No Matches
CounterDuplicationCode Class Reference

Code duplication analyzer and reporter. More...

#include <counter_duplication_code.hpp>

+ Inheritance diagram for CounterDuplicationCode:
+ Collaboration diagram for CounterDuplicationCode:

Public Member Functions

 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.
 
- Public Member Functions inherited from CommandBase< CounterDuplicationCode >
virtual void print_help (const std::string command_name, const OptionsCollector *collector) const
 
const CliOptionoptions () const final
 
bool do_run (const std::string command_name, const ParsedOptions &options, const OptionsCollector *collector=nullptr) override
 
- Public Member Functions inherited from ICommand
virtual ~ICommand ()=default
 
virtual std::string_view description () const =0
 

Detailed Description

Code duplication analyzer and reporter.

Provides functionality to analyze and report code duplication metrics across the codebase, organized by folder hierarchy using a trie structure for efficient hierarchical counting and reporting.

Definition at line 30 of file counter_duplication_code.hpp.

Member Function Documentation

◆ COMMAND_DESCRIPTION()

CounterDuplicationCode::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."  )

Constructs analyzer with similarity data.

Parameters
_similarity_tablePointer to similarity table

◆ run()

bool CounterDuplicationCode::run ( const ParsedOptions & options)
overridevirtual

Handles duplication analysis command.

Implements ICommand.

Definition at line 55 of file counter_duplication_code.cpp.

◆ validate()

bool CounterDuplicationCode::validate ( const ParsedOptions & options)
overridevirtual

Validate the arguments already analyzed.

Verify that all required options have been selected and that the values ​​provided are valid.

Parameters
optionsThe ParsedOptions structure will be populated with the arguments.
Returns
True if the arguments are valid, false otherwise.

Implements ICommand.

Definition at line 46 of file counter_duplication_code.cpp.


The documentation for this class was generated from the following files: