if (groupCount > 1) { double groupGap = space * getItemMargin() / (categoryCount * (groupCount - 1)); double groupW = calculateSeriesWidth(space, domainAxis, categoryCount, groupCount); barW0 = barW0 + groupIndex * (groupW + groupGap) + (groupW / 2.0) - (state.getBarWidth() / 2.0); } else { barW0 = domainAxis.getCategoryMiddle(column, getColumnCount(), dataArea, plot.getDomainAxisEdge()) - state.getBarWidth() / 2.0; }
if (seriesCount > 1) { double seriesGap = space * getItemMargin() / (categoryCount * (seriesCount - 1)); double seriesW = calculateSeriesWidth(space, domainAxis, categoryCount, seriesCount); barW0 = barW0 + row * (seriesW + seriesGap) + (seriesW / 2.0) - (state.getBarWidth() / 2.0); } else { barW0 = domainAxis.getCategoryMiddle(column, getColumnCount(), dataArea, plot.getDomainAxisEdge()) - state.getBarWidth() / 2.0; }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/GroupedStackedBarRenderer.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/LevelRenderer.java
Method name: double calculateBarW0(CategoryPlot, PlotOrientation, Rectangle2D, CategoryAxis, CategoryItemRendererState, int, int) Method name: double calculateBarW0(CategoryPlot, PlotOrientation, Rectangle2D, CategoryAxis, CategoryItemRendererState, int, int)
Number of AST nodes: 5 Number of AST nodes: 5
1
if (groupCount > 1) {
1
if (seriesCount > 1) {
2
            double groupGap = space * getItemMargin()
2
            double seriesGap = space * getItemMargin()
3
                              / (categoryCount * (groupCount - 1));
3
                    / (categoryCount * (seriesCount - 1));
4
            double groupW = calculateSeriesWidth(space, domainAxis,
4
            double seriesW = calculateSeriesWidth(space, domainAxis,
5
                    categoryCount, groupCount);
5
                    categoryCount, seriesCount);
6
            barW0 = barW0 + groupIndex * (groupW + groupGap)
6
            barW0 = barW0 + row * (seriesW + seriesGap)
7
                          + (groupW / 2.0) - (state.getBarWidth() / 2.0);
7
                          + (seriesW / 2.0) - (state.getBarWidth() / 2.0);
8
        }
8
        }
9
        else {
9
        else {
10
            barW0 = domainAxis.getCategoryMiddle(column, getColumnCount(),
10
            barW0 = domainAxis.getCategoryMiddle(column, getColumnCount(),
11
                    dataArea, plot.getDomainAxisEdge())
11
                    dataArea, plot.getDomainAxisEdge())
12
                    - state.getBarWidth()
12
 - state.getBarWidth()
13
 / 2.0;
13
                    / 2.0;
14
        }
14
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are in different classes having the same super class
Number of node comparisons25
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)78.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    9
    if (groupCount > 1)
    9
    if (groupCount > 1)
    8
    if (seriesCount > 1)
    Differences
    Expression1Expression2Difference
    groupCountseriesCountVARIABLE_NAME_MISMATCH
    8
    if (seriesCount > 1)
    10
    double groupGap = space * getItemMargin() / (categoryCount * (groupCount - 1));
    10
    double groupGap = space * getItemMargin() / (categoryCount * (groupCount - 1));
    9
    double seriesGap = space * getItemMargin() / (categoryCount * (seriesCount - 1));
    Differences
    Expression1Expression2Difference
    groupGapseriesGapVARIABLE_NAME_MISMATCH
    groupCountseriesCountVARIABLE_NAME_MISMATCH
    9
    double seriesGap = space * getItemMargin() / (categoryCount * (seriesCount - 1));
    11
    double groupW = calculateSeriesWidth(space, domainAxis, categoryCount, groupCount);
    11
    double groupW = calculateSeriesWidth(space, domainAxis, categoryCount, groupCount);
    10
    double seriesW = calculateSeriesWidth(space, domainAxis, categoryCount, seriesCount);
    Differences
    Expression1Expression2Difference
    groupWseriesWVARIABLE_NAME_MISMATCH
    groupCountseriesCountVARIABLE_NAME_MISMATCH
    10
    double seriesW = calculateSeriesWidth(space, domainAxis, categoryCount, seriesCount);
    12
    barW0 = barW0 + groupIndex * (groupW + groupGap) + (groupW / 2.0) - (state.getBarWidth() / 2.0);
    12
    barW0 = barW0 + groupIndex * (groupW + groupGap) + (groupW / 2.0) - (state.getBarWidth() / 2.0);
    11
    barW0 = barW0 + row * (seriesW + seriesGap) + (seriesW / 2.0) - (state.getBarWidth() / 2.0);
    Differences
    Expression1Expression2Difference
    groupIndexrowVARIABLE_NAME_MISMATCH
    groupWseriesWVARIABLE_NAME_MISMATCH
    groupGapseriesGapVARIABLE_NAME_MISMATCH
    groupWseriesWVARIABLE_NAME_MISMATCH
    11
    barW0 = barW0 + row * (seriesW + seriesGap) + (seriesW / 2.0) - (state.getBarWidth() / 2.0);
    else
    else
    13
    barW0 = domainAxis.getCategoryMiddle(column, getColumnCount(), dataArea, plot.getDomainAxisEdge()) - state.getBarWidth() / 2.0;
    12
    barW0 = domainAxis.getCategoryMiddle(column, getColumnCount(), dataArea, plot.getDomainAxisEdge()) - state.getBarWidth() / 2.0;
    Precondition Violations (0)
    Row Violation