|
Arkanjo 0.1
A tool for find code duplicated functions in codebases
|
The arkanjo is a cli tool is designed to help developers find code duplications in their codebases. The tool is designed to find duplication in the scope of functions.
The current functionalities of the tool are:
There are some other functionalities used for the cretor master degree, but should not matter for an end user.
From now on, we will use the term commands instead of functionalities.
The tool current should cover the C programming language. The tool also supports Java with limitations.
The tool current uses the concept of similarity. The user can pass a similarity threshold to the tool. This similarity threshold is used for limiting what the tool consider a duplication.
The similarity threshold is a number between 0 and 100. If you set the threshold to 0, everything is considered a duplication. If you set the threhold to 100, only complety equal functions are considered duplications. The current state of the tool gives good results for similarity threshols around ~90.
The arkanjo tool uses as a subrotine the Duplicate Code Detection Tool to generate the similarity metrics.
The tool have only being tested on ubuntu operation systems. The instalation guide could included.
Run on the terminal the following commands to install the dependencies:
Download the source code:
Go to the tool folder:
Build the binary:
The tool is designed to have a heavy preprocesing, to enable the tool to answer different kind of queries fastly.
To do the preprocessing, execute the preprocessor:
The preprocessor will ask for the complete path to the codebase you are interested to find code duplications and the similarity threshold.
The preprocessor can take a while to execute. Depending on the size of the codebases, it cannot run or take a some hours.
To execute the tool and the tool functionalities, you need to run the command that respect this format:
If you have not executed the preprocessor, the tool will automatically call the preprocessor.
The shared parameters over all commands are:
The following are the guide on how to execute the current commands of the tool:
To execute the explore duplications command, run:
All the positional parameters are optional, and the meaning of them are the following:
To execute the relatory commands, execute:
Where <FUNCTION_NAME> is a parameter passed by the user. The tool will match the parameter with any function that has the FUNCTION_NAME as a substring.
To execute the relatory commands, execute: