test.c
void fun(){
printf("int main char");
}
int main()
{
printf("int main int");
}
Im giving the command like this "run.sh cpd --minimum-tokens 5 --files /opt/test.c --language c" and the output is as follows :
Found a 2 line (5 tokens) duplication in the following files:
Starting at line 1 of /opt/test.c
Starting at line 5 of /opt/test.c
void fun(){
printf("int main char ");
Even if there is no duplication, it is telling the code is duplicated because of minimum tokens. Is there any way to specify the command without minimum tokens flag.
void fun(){
printf("int main int");
}
int main(){
printf("int main int");
}
I specified the command like this "run.sh cpd --minimum-tokens 9 --files /opt/test.c --language c" the output is as follows:
Added /opt/test.c <--- (No line duplication reported by tool)
This is because I specified the token value greater than the required token value which is 8. In the above case even if there is a duplicated code the tool is not returning any duplicated code.
So how to conclude on Min token size in such scenario in order to get correct duplication of code