1289-1-2

if (isInverted()) { return max - ((value - this.displayStart) / (this.displayEnd - this.displayStart)) * (max - min); } else { return min + ((value - this.displayStart) / (this.displayEnd - this.displayStart)) * (max - min); }
if (isInverted()) { return max - ((value - this.displayStart) / (this.fixedRange.getUpperBound() - this.displayStart)) * (max - min); } else { return min + ((value - this.displayStart) / (this.fixedRange.getUpperBound() - this.displayStart)) * (max - min); }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/ModuloAxis.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/ModuloAxis.java
Method name: `double trans(double, Rectangle2D, RectangleEdge)` |  | Method name: `double transStart(double, Rectangle2D, RectangleEdge, double, double)`
Number of AST nodes: 3 |  | Number of AST nodes: 3

1

    if (isInverted()) {↵

1

    if (isInverted()) {↵

2

                return max - ((value - this.displayStart) ↵

2

                return max - ((value - this.displayStart) ↵

3

                       / (this.displayEnd - this.displayStart)) ↵

3

                    / (this.fixedRange.getUpperBound() - this.displayStart)) ↵

4

    * (max - min);↵

4

                    * (max - min);↵

5

            }↵

5

            }↵

6

            else {↵

6

            else {↵

7

                return min + ((value - this.displayStart) ↵

7

                return min + ((value - this.displayStart) ↵

8

                       / (this.displayEnd - this.displayStart)) ↵

8

                    / (this.fixedRange.getUpperBound() - this.displayStart)) ↵

9

    * (max - min);↵

9

                    * (max - min);↵

10

            }

10

            }

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 1
Number of non-refactorable cases | 0
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1
Clones location | Clones are declared in the same class
Number of node comparisons | 9

1. {Refactorable}

   Mapping Summary
   Number of mapped statements | 3
   Number of unmapped statements in the first code fragment | 0
   Number of unmapped statements in the second code fragment | 0
   Time elapsed for statement mapping (ms) | 1.8
   Clone type | Type 2

   Mapped Statements
   ID | Statement |  | ID | Statement
   --- | --- | --- | --- | ---

   9

       if (isInverted())

   9

       if (isInverted())

   10

       return max - ((value - this.displayStart) / (this.displayEnd - this.displayStart)) * (max - min);

   10 | return max - ((value - this.displayStart) / (this.displayEnd - this.displayStart)) * (max - min);
   10 | return max - ((value - this.displayStart) / (this.fixedRange.getUpperBound() - this.displayStart)) * (max - min);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   this.displayEnd | this.fixedRange.getUpperBound() | TYPE_COMPATIBLE_REPLACEMENT

   10

       return max - ((value - this.displayStart) / (this.fixedRange.getUpperBound() - this.displayStart)) * (max - min);

       else

       else

   11

       return min + ((value - this.displayStart) / (this.displayEnd - this.displayStart)) * (max - min);

   11 | return min + ((value - this.displayStart) / (this.displayEnd - this.displayStart)) * (max - min);
   11 | return min + ((value - this.displayStart) / (this.fixedRange.getUpperBound() - this.displayStart)) * (max - min);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   this.displayEnd | this.fixedRange.getUpperBound() | TYPE_COMPATIBLE_REPLACEMENT

   11

       return min + ((value - this.displayStart) / (this.fixedRange.getUpperBound() - this.displayStart)) * (max - min);

   Precondition Violations (0)
   Row | Violation
   --- | ---