Open stonecauldron opened 4 years ago
Can check a few values in the report, please:
#Clones: 8
, as you imported 8 clones. <#detected> / <#total> = <recall>
. Is it correct that both "#detected" and "recall" are 0 for all types?Thank you for getting back to me.
Line 4 of the report does indeed say that 8 clones were successfully.
My problem comes from the fact that the recall in the report is equal to 0, despite some of the clones in sample/BinarySearch.java
having been detected by my tool.
For example, the pair below was classified as a clone by my tool:
sample,BinarySearch.java,6,16,sample,BinarySearch.java,19,29
In code this pair corresponds to these two BinarySearch functions which are indeed clones:
public static int binarySearch1(int arr[], int key, int imin, int imax) {
//Implementation: Recursive, primitive type
if(imax < imin)
return -1;
int imid = (imin+imax)/2;
if(arr[imid] > key)
return binarySearch1(arr,key,imin,imid-1);
else if (arr[imid] < key)
return binarySearch1(arr,key,imid+1,imax);
else
return imid;
public static <T extends Comparable<T>> int binarySearch3(T[] arr, T key, int imin, int imax) {
//Implementation: Recursive, comparable type
if(imax < imin)
return -1;
int imid = (imin+imax)/2;
if(arr[imid].compareTo(key) > 0)
return binarySearch3(arr,key,imin,imid-1);
else if (arr[imid].compareTo(key) < 0)
return binarySearch3(arr,key,imid+1,imax);
else
return imid;
}
I want to evaluate a tool with BigCloneEval.
To this end, I started with a single file to ensure that the whole pipeline works without issue. I ran my tool on
BinarySearch.java
.Here are the detected clone pairs:
Following the README instructions, I registered a new tool, imported the pairs reported in the above file and ran the
evaluateTool
command in the following way.In the generated report recall is equal to 0 for every clone type despite the clone pairs in
BinarySearch.java
having been correctly detected.I manually checked the tools database and the pairs were imported without issue.
Do you know what could be causing this problem? Are the parameter values I am using in
evaluateTool
inappropriate?