CloneSet2


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
28260.959class_body_declarations[2]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
12857
Basic_Class1.java
22894
Basic_Class1.java
Clone Instance
1
Line Count
28
Source Line
57
Source File
Basic_Class1.java

        // ****************************************************************
        // ************************ Type 1 Clones   ***********************
        // ****************************************************************


        // Note: The following clones were taken from work by Krawitz

        //Type-1 Clones - Krawitz
        public double Type1a_Krawitz(int n)
        {
        int p = -1;
        int sum = 0;

        for (p = 0; p < n; p++)
        {
                sum += p;
        }

        if (n == 0) return sum;
        else return sum / n;
        }

        // Type 1 Clone - Krawitz
        public double Type1b_Krawitz(int n)
        {
        int p = -1;
        int sum = 0;

        //this is a comment that is not in any other method()
        for (p = 0; p < n; p++)
                sum += p;

        if (n == 0)
                return sum;
        else
                return sum / n;
        }


Clone Instance
2
Line Count
28
Source Line
94
Source File
Basic_Class1.java

        // ****************************************************************
        // ************************ Type 2 Clones   ***********************
        // ****************************************************************

        //Type-2 Clones - Krawitz
        public double Type2a_Krawitz(int n)
        {
        int q = -1;
        double sum = 0;

        for (q = 0; q < n; q++)
        {
        sum += q;
        }

        if (n == 0) return sum;
        else return sum / n;
        }

        //Type-2 Clones - Krawitz
        public double Type2b_Krawitz(int t)
        {
        int p = -1;
        int tot = 0;

        //this is a comment that is not the same as any other comment
        for (p = 0; p < t; p++)
        tot += p;

        if (t == 0)
        return tot;
        else
        return tot / t;
        }


Clone AbstractionParameter Count: 6Parameter Bindings

// ****************************************************************
// ************************ Type 2 Clones   ***********************
// ************************ Type 1 Clones   ***********************
// ****************************************************************
//Type-2 Clones - Krawitz
// Note: The following clones were taken from work by Krawitz
//Type-1 Clones - Krawitz
public double  [[#variable6a6bda0]](int n) {
  int  [[#variable6a6bd40]]= -1;
   [[#variable6a6bce0]] sum = 0;
  for ( [[#variable6a6bd40]]= 0; [[#variable6a6bd40]] < n; [[#variable6a6bd40]]++) {
    sum += [[#variable6a6bd40]];
  }
  if (n == 0)
    return sum;
  else
    return sum / n;
}

//Type-2 Clones - Krawitz
// Type 1 Clone - Krawitz
public double  [[#variable6a6bc80]](int  [[#variable6a6bb60]]) {
  int p = -1;
  int  [[#variable6a6bb00]]= 0;
  //this is a comment that is not the same as any other comment
  //this is a comment that is not in any other method()
  for (p = 0; p <  [[#variable6a6bb60]]; p++)
     [[#variable6a6bb00]]+= p;
  if ( [[#variable6a6bb60]]== 0)
    return [[#variable6a6bb00]];
  else
    return [[#variable6a6bb00]] /  [[#variable6a6bb60]];
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#6a6bda0]]
Type2a_Krawitz 
12[[#6a6bda0]]
Type1a_Krawitz 
21[[#6a6bd40]]
q 
22[[#6a6bd40]]
p 
31[[#6a6bce0]]
double 
32[[#6a6bce0]]
int 
41[[#6a6bc80]]
Type2b_Krawitz 
42[[#6a6bc80]]
Type1b_Krawitz 
51[[#6a6bb60]]
t 
52[[#6a6bb60]]
n 
61[[#6a6bb00]]
tot 
62[[#6a6bb00]]
sum