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 |
| |
See real code fragment | See real code fragment |
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 |
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) | 78.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9 | if (groupCount > 1) |
| 8 | if (seriesCount > 1) | |||||||||||||||||||
10 | double groupGap = space * getItemMargin() / (categoryCount * (groupCount - 1)); |
| 9 | double seriesGap = space * getItemMargin() / (categoryCount * (seriesCount - 1)); | |||||||||||||||||||
11 | double groupW = calculateSeriesWidth(space, domainAxis, categoryCount, groupCount); |
| 10 | double seriesW = calculateSeriesWidth(space, domainAxis, categoryCount, seriesCount); | |||||||||||||||||||
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); | |||||||||||||||||||
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; |
Row | Violation |
---|