Please follow these steps:
First: Open the code project
We will be working on the example project provided by ConQAT:
First: Open the code project
We will be working on the example project provided by ConQAT:
- Open Eclipse
- Goto: New Project > Examples > ConQAT Examples > ConQAT Examples Project
Second: Run the code clones analysis tools
- Double click the clonedetection-example-junit.cqr
- Click Launch ConQAT analysis
- After it finishes, goto Menu: Clone Detection > Open Clone Report, and select the clones.xml file in the output directory
Third: Detecting exact code clones
- Back to the clonedetection-example-junit.cqr page
- Scroll all the way to the right and click the 'New' button
- Add the field 'equality', and enter value 1 in the threshold
- Launch the analysis and reload the clones.xml file
Forth: Detecting similar code clones
- Back to the clonedetection-example-junit.cqr page
- Scroll all the way to the right and click the 'New' button
- Add the field 'similarity', and enter value 1 in the threshold
- Remove the 'equality' parameter
- Launch the analysis and reload the clones.xml file
Fifth: Detecting gapped clones
- Goto the 'ConQat blocks' section at the top right of the configuration file
- Click on 'Change' button
- Select 'Code Clones > JavaGappedClonesAnalysis'
- Add a parameter called 'errors' and enter the value = 2
- Add a parameter called 'gap' and enter the ratio = 0.2
- Launch the analysis and reload the clones-gapped.xml file (notice the file name is different than the previous ones)