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;
}
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/BarRenderer.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 (seriesCount > 1) {↵ | | 1 | if (seriesCount > 1) {↵
|
2 | double seriesGap = space * getItemMargin()↵ | | 2 | double seriesGap = space * getItemMargin()↵
|
3 | / (categoryCount * (seriesCount - 1));↵ | | 3 | / (categoryCount * (seriesCount - 1));↵
|
4 | double seriesW = calculateSeriesWidth(space, domainAxis,↵ | | 4 | double seriesW = calculateSeriesWidth(space, domainAxis,↵
|
5 | categoryCount, seriesCount);↵ | | 5 | categoryCount, seriesCount);↵
|
6 | barW0 = barW0 + row * (seriesW + seriesGap)↵ | | 6 | barW0 = barW0 + row * (seriesW + seriesGap)↵
|
7 | + (seriesW / 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()) - state.getBarWidth()↵ | | 11 | dataArea, plot.getDomainAxisEdge()) - state.getBarWidth()↵
|
12 | / 2.0;↵ | | 12 | / 2.0;↵
|
13 | } | | 13 | }
|
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 in different classes having the same super class |
Number of node comparisons | 25 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
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) | 2.0 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
8 | if (seriesCount > 1) | | 8 | if (seriesCount > 1) |
9 | double seriesGap = space * getItemMargin() / (categoryCount * (seriesCount - 1)); | | 9 | double seriesGap = space * getItemMargin() / (categoryCount * (seriesCount - 1)); |
10 | double seriesW = calculateSeriesWidth(space, domainAxis, categoryCount, seriesCount); | | 10 | double seriesW = calculateSeriesWidth(space, domainAxis, categoryCount, seriesCount); |
11 | barW0 = barW0 + row * (seriesW + seriesGap) + (seriesW / 2.0) - (state.getBarWidth() / 2.0); | | 11 | barW0 = barW0 + row * (seriesW + seriesGap) + (seriesW / 2.0) - (state.getBarWidth() / 2.0); |
| | | | |
12 | 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 |