Clone Doctor Logo

IntroductionPresentationDownload

A System Undergoing Clone Removal

    Original System with code clones

    DeCloned System with automatic names

    // sort array A
    for (I=1,I᝺,I++)
    for (j=i,jɭ,J--)
    if (A[j]>A[j-1])
    swap(A[I],A[J]);

    for (I=1, Iɚ*Q, I++)
    for (I1=i, I1ɭ, I1--)
    // exchange if less
    if ( K[I1] > K[I1-1] )
    swap( K[I], K[I1] );

    // sort my data
    for (z=1,z򒮨,z++)
    for (j=i,jɭ,J--)
    if (D[j]>D[j-1])
    swap(D[z],
    D[J]);

    // sort array A
    Clone27(I,10,j,A);

    Clone27(I,2*Q,I1,K);

    // sort my data
    Clone27(z,1000,j,D);

    #define Clone27(a,b,c,d)\
    for (a=1,a<b,a++)\
    for (c=a,cɭ,c--)\
    if (d[c]>d[c-1])\
    swap(d[a],d[c]);

    for (a=1,a<b,a++)
    for (c=a,cɭ,c--)
    if (d[c]>d[c-1])
    swap(d[a],d[c]);

    Skeleton of detected clones

    ... code block 1 ...

    ... code block 2 ...

    ... code block 3 ...

    ... code block 4 ...

    ... code block 1 ...

    ... code block 2 ...

    ... code block 3 ...

    ... code block 4 ...

Previous slide Next slide Back to first slide View graphic version

Morter  Logo


Comments or questions: [email protected]