double min = 0.0; double max = 0.0; if (RectangleEdge.isTopOrBottom(edge)) { min = area.getX(); max = area.getX() + area.getWidth() * length1 / (length1 + length2); } else if (RectangleEdge.isLeftOrRight(edge)) { min = area.getMaxY(); max = area.getMaxY() - area.getHeight() * length1 / (length1 + length2); } 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); }
double min = 0.0; double max = 0.0; if (RectangleEdge.isTopOrBottom(edge)) { max = area.getMaxX(); min = area.getMaxX() - area.getWidth() * length2 / (length1 + length2); } else if (RectangleEdge.isLeftOrRight(edge)) { max = area.getMinY(); min = area.getMinY() + area.getHeight() * length2 / (length1 + length2); } if (isInverted()) { return max - ((value - this.fixedRange.getLowerBound()) / (this.displayEnd - this.fixedRange.getLowerBound())) * (max - min); } else { return min + ((value - this.fixedRange.getLowerBound()) / (this.displayEnd - this.fixedRange.getLowerBound())) * (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 transStart(double, Rectangle2D, RectangleEdge, double, double) Method name: double transEnd(double, Rectangle2D, RectangleEdge, double, double)
Number of AST nodes: 11 Number of AST nodes: 11
1
double min = 0.0;
1
double min = 0.0;
2
        double max = 0.0;
2
        double max = 0.0;
3
        if (RectangleEdge.isTopOrBottom(edge)) {
3
        if (RectangleEdge.isTopOrBottom(edge)) {
4
            min = area.getX();
4
            max = area.getMaxX();
5
            max = area.getX() + area.getWidth() * length1
5
            min = area.getMaxX() - area.getWidth() * length2 
6
 / (length1 + length2);
6
                  / (length1 + length2);
7
        }
7
        }
8
        else if (RectangleEdge.isLeftOrRight(edge)) {
8
        else if (RectangleEdge.isLeftOrRight(edge)) {
9
            min = area.getMaxY();
9
            max = area.getMinY();
10
            max = area.getMaxY() - area.getHeight() * length1 
10
            min = area.getMinY() + area.getHeight() * length2 
11
                  / (length1 + length2);
11
                  / (length1 + length2);
12
        }
12
        }
13
        if (isInverted()) {
13
        if (isInverted()) {
14
            return max - ((value - this.displayStart) 
14
            return max - ((value - this.
15
fixedRange.getLowerBound()) 
15
                / (this.fixedRange.getUpperBound() - this.displayStart)) 
16
                    / (this.displayEnd - this.fixedRange.getLowerBound())) 
16
                * (max - min);
17
                    * (max - min);
17
        }
18
        }
18
        else {
19
        else {
19
            return min + ((value - this.displayStart) 
20
            return min + ((value - this.
21
fixedRange.getLowerBound()) 
20
                / (this.fixedRange.getUpperBound() - this.displayStart)) 
22
                    / (this.displayEnd - this.fixedRange.getLowerBound())) 
21
                * (max - min);
23
                    * (max - min);
22
        }
24
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.5
Clones locationClones are declared in the same class
Number of node comparisons61
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements11
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)12.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    double min = 0.0;
    1
    double min = 0.0;
    2
    double max = 0.0;
    2
    double max = 0.0;
    3
    if (RectangleEdge.isTopOrBottom(edge))
    3
    if (RectangleEdge.isTopOrBottom(edge))
    4
    min = area.getX();
    4
    min = area.getX();
    4
    max = area.getMaxX();
    Differences
    Expression1Expression2Difference
    minmaxVARIABLE_NAME_MISMATCH
    getXgetMaxXMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression min cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression max cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    max = area.getMaxX();
    5
    max = area.getX() + area.getWidth() * length1 / (length1 + length2);
    5
    max = area.getX() + area.getWidth() * length1 / (length1 + length2);
    5
    min = area.getMaxX() - area.getWidth() * length2 / (length1 + length2);
    Differences
    Expression1Expression2Difference
    maxminVARIABLE_NAME_MISMATCH
    getXgetMaxXMETHOD_INVOCATION_NAME_MISMATCH
    length1length2VARIABLE_NAME_MISMATCH
    +-OPERATOR_MISMATCH
    Preondition Violations
    Expression max cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression min cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    min = area.getMaxX() - area.getWidth() * length2 / (length1 + length2);
    6
    else if (RectangleEdge.isLeftOrRight(edge))
    6
    else if (RectangleEdge.isLeftOrRight(edge))
    7
    min = area.getMaxY();
    7
    min = area.getMaxY();
    7
    max = area.getMinY();
    Differences
    Expression1Expression2Difference
    minmaxVARIABLE_NAME_MISMATCH
    getMaxYgetMinYMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression min cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression max cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7
    max = area.getMinY();
    8
    max = area.getMaxY() - area.getHeight() * length1 / (length1 + length2);
    8
    max = area.getMaxY() - area.getHeight() * length1 / (length1 + length2);
    8
    min = area.getMinY() + area.getHeight() * length2 / (length1 + length2);
    Differences
    Expression1Expression2Difference
    maxminVARIABLE_NAME_MISMATCH
    getMaxYgetMinYMETHOD_INVOCATION_NAME_MISMATCH
    length1length2VARIABLE_NAME_MISMATCH
    -+OPERATOR_MISMATCH
    Preondition Violations
    Expression max cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression min cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    min = area.getMinY() + area.getHeight() * length2 / (length1 + length2);
    9
    if (isInverted())
    9
    if (isInverted())
    10
    return max - ((value - this.displayStart) / (this.fixedRange.getUpperBound() - this.displayStart)) * (max - min);
    10
    return max - ((value - this.displayStart) / (this.fixedRange.getUpperBound() - this.displayStart)) * (max - min);
    10
    return max - ((value - this.fixedRange.getLowerBound()) / (this.displayEnd - this.fixedRange.getLowerBound())) * (max - min);
    Differences
    Expression1Expression2Difference
    this.displayStartthis.fixedRange.getLowerBound()TYPE_COMPATIBLE_REPLACEMENT
    this.fixedRange.getUpperBound()this.displayEndTYPE_COMPATIBLE_REPLACEMENT
    this.displayStartthis.fixedRange.getLowerBound()TYPE_COMPATIBLE_REPLACEMENT
    10
    return max - ((value - this.fixedRange.getLowerBound()) / (this.displayEnd - this.fixedRange.getLowerBound())) * (max - min);
    else
    else
    11
    return min + ((value - this.displayStart) / (this.fixedRange.getUpperBound() - this.displayStart)) * (max - min);
    11
    return min + ((value - this.displayStart) / (this.fixedRange.getUpperBound() - this.displayStart)) * (max - min);
    11
    return min + ((value - this.fixedRange.getLowerBound()) / (this.displayEnd - this.fixedRange.getLowerBound())) * (max - min);
    Differences
    Expression1Expression2Difference
    this.displayStartthis.fixedRange.getLowerBound()TYPE_COMPATIBLE_REPLACEMENT
    this.fixedRange.getUpperBound()this.displayEndTYPE_COMPATIBLE_REPLACEMENT
    this.displayStartthis.fixedRange.getLowerBound()TYPE_COMPATIBLE_REPLACEMENT
    11
    return min + ((value - this.fixedRange.getLowerBound()) / (this.displayEnd - this.fixedRange.getLowerBound())) * (max - min);
    Precondition Violations (8)
    Row Violation
    1Expression min cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression max cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression max cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression min cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression min cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression max cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression max cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression min cannot be parameterized, because it has dependencies to/from statements that will be extracted