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

Main function extraction processor. More...

#include <function_breaker.hpp>

Public Member Functions

int process (const fs::path &folder_path, std::function< void(const FunctionData &)> on_function, SkipStats &stats, int minimum_lines=0, Granularity granularity=Granularity::Function)
 Processes all files in directory. More...
 
 FunctionBreaker ()=default
 Constructs function breaker and processes directory. More...
 

Detailed Description

Main function extraction processor.

Analyzes source code directories (C/C++/Java) and extracts each function into individual files within a temporary repository. Handles file organization and delegates language-specific parsing to appropriate handlers.

Note
Current limitations:
  • May not work correctly with malformed bracket sequences
  • May fail on brackets within comments
  • Example behavior: For file example.c with functions a and b, creates example/a.c and example/b.c in tmp/ directory

Definition at line 56 of file function_breaker.hpp.

Constructor & Destructor Documentation

◆ FunctionBreaker()

FunctionBreaker::FunctionBreaker ( )
default

Constructs function breaker and processes directory.

Parameters
folder_pathDirectory containing source files to process

Member Function Documentation

◆ process()

int FunctionBreaker::process ( const fs::path &  folder_path,
std::function< void(const FunctionData &)>  on_function,
SkipStats &  stats,
int  minimum_lines = 0,
Granularity  granularity = Granularity::Function 
)

Processes all files in directory.

Parameters
folder_pathDirectory path to process
on_functionCallback invoked for every extracted unit
granularityWhether to break the codebase by function or by file

Definition at line 82 of file function_breaker.cpp.


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