ArKanjo 0.5.1
A tool for find code duplicated functions in codebases
TfidfMethod Class Reference

Main code duplication detection tool. More...

#include <tfidf_method.hpp>

+ Inheritance diagram for TfidfMethod:
+ Collaboration diagram for TfidfMethod:

Public Member Functions

 TfidfMethod (const fs::path &base_path_, double similarity_)
 Constructs the duplication finder tool. More...
 
void execute_by_feature (const fs::path &path, const std::string feature_name="")
 Executes the full duplication analysis pipeline. More...
 
void on_function (const FunctionData &fd) override
 
void execute () override
 
- Public Member Functions inherited from IMethod
virtual ~IMethod ()=default
 
virtual void save_duplications (std::vector< DuplicationEntry > &)
 Output line format: More...
 
virtual void on_function (const FunctionData &fd)=0
 
virtual void execute ()=0
 

Detailed Description

Main code duplication detection tool.

Orchestrates the preprocessing pipeline that analyzes the entire codebase to identify and catalog potential code duplications, creating the foundation for efficient similarity queries during the tool's operation phase.

Definition at line 29 of file tfidf_method.hpp.

Constructor & Destructor Documentation

◆ TfidfMethod()

TfidfMethod::TfidfMethod ( const fs::path &  base_path_,
double  similarity_ 
)

Constructs the duplication finder tool.

Parameters
base_path_Root path of the codebase to analyze
similarity_Minimum similarity threshold (0-100) to consider as duplicate

Definition at line 11 of file tfidf_method.cpp.

Member Function Documentation

◆ execute()

void TfidfMethod::execute ( )
overridevirtual

Implements IMethod.

Definition at line 60 of file tfidf_method.cpp.

◆ execute_by_feature()

void TfidfMethod::execute_by_feature ( const fs::path &  path,
const std::string  feature_name = "" 
)

Executes the full duplication analysis pipeline.

Performs the complete preprocessing and analysis of the codebase, including file scanning, similarity comparison, and result saving.

Definition at line 16 of file tfidf_method.cpp.

◆ on_function()

void TfidfMethod::on_function ( const FunctionData &  fd)
overridevirtual

Implements IMethod.

Definition at line 47 of file tfidf_method.cpp.


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