File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/DateAxis.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/NumberAxis.java | |||
Method name: AxisState draw(Graphics2D, double, Rectangle2D, Rectangle2D, RectangleEdge, PlotRenderingInfo)
|
Method name: AxisState draw(Graphics2D, double, Rectangle2D, Rectangle2D, RectangleEdge, PlotRenderingInfo)
|
|||
Number of AST nodes: 8 | Number of AST nodes: 9 | |||
1 | AxisState state = null;↵ | |||
2 | // if the axis is not visible, don't draw it...↵ | |||
1 | if (!isVisible()) {↵ | 3 | if (!isVisible()) {↵ | |
2 | AxisState state = new AxisState(cursor);↵ | 4 | state = new AxisState(cursor);↵ | |
3 | // even though the axis is not visible, we need to refresh ticks in↵ | 5 | // even though the axis is not visible, we need ticks for the↵ | |
4 | // case the grid is being drawn...↵ | 6 | // gridlines...↵ | |
5 | List ticks = refreshTicks(g2, state, dataArea, edge);↵ | 7 | List ticks = refreshTicks(g2, state, dataArea, edge);↵ | |
6 | state.setTicks(ticks);↵ | 8 | state.setTicks(ticks);↵ | |
7 | return state;↵ | 9 | return state;↵ | |
8 | }↵ | 10 | }↵ | |
9 | // draw the tick marks and labels...↵ | 11 | // draw the tick marks and labels...↵ | |
10 | AxisState state = drawTickMarksAndLabels(g2, cursor, plotArea,↵ | 12 | state = drawTickMarksAndLabels(g2, cursor, plotArea,↵ | |
11 | dataArea, edge);↵ | 13 | dataArea, edge);↵ | |
12 | // draw the axis label (note that 'state' is passed in *and*↵ | 14 | // // draw the ↵ | |
13 | // returned)↵ | 15 | marker band (if there is one)...↵ | |
16 | // if (getMarkerBand() != null) {↵ | |||
17 | // if (edge == RectangleEdge.BOTTOM) {↵ | |||
18 | // cursor = cursor - getMarkerBand().getHeight(g2);↵ | |||
19 | // }↵ | |||
20 | // getMarkerBand().draw(g2, plotArea, dataArea, 0, cursor);↵ | |||
21 | // }↵ | |||
14 | ...↵ | 22 | // draw the axis label...↵ | |
15 | state = drawLabel(getLabel(), g2, plotArea, dataArea, edge, state);↵ | 23 | state = drawLabel(getLabel(), g2, plotArea, dataArea, edge, state);↵ | |
16 | return state; | 24 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
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 | 34 |
Number of mapped statements | 10 |
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) | 44.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | AxisState state = null; | |||||||||||||||||||
1 | if (!isVisible()) | 2 | if (!isVisible()) | ||||||||||||||||||
2 | AxisState state = new AxisState(cursor); | 3 | state = new AxisState(cursor); | ||||||||||||||||||
3 | List ticks = refreshTicks(g2, state, dataArea, edge); | 4 | List ticks = refreshTicks(g2, state, dataArea, edge); | ||||||||||||||||||
4 | state.setTicks(ticks); | 5 | state.setTicks(ticks); | ||||||||||||||||||
5 | return state; | 6 | return state; | ||||||||||||||||||
6 | AxisState state = drawTickMarksAndLabels(g2, cursor, plotArea, dataArea, edge); |
| 8 | state = drawLabel(getLabel(), g2, plotArea, dataArea, edge, state); | |||||||||||||||||
7 | state = drawLabel(getLabel(), g2, plotArea, dataArea, edge, state); |
| 7 | state = drawTickMarksAndLabels(g2, cursor, plotArea, dataArea, edge); | |||||||||||||||||
8 | return state; | 9 | return state; |
Row | Violation |
---|---|
1 | Expression drawTickMarksAndLabels(g2,cursor,plotArea,dataArea,edge) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression drawLabel(getLabel(),g2,plotArea,dataArea,edge,state) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression drawTickMarksAndLabels(g2,cursor,plotArea,dataArea,edge) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression drawLabel(getLabel(),g2,plotArea,dataArea,edge,state) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression drawLabel(getLabel(),g2,plotArea,dataArea,edge,state) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression drawTickMarksAndLabels(g2,cursor,plotArea,dataArea,edge) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression drawLabel(getLabel(),g2,plotArea,dataArea,edge,state) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression drawTickMarksAndLabels(g2,cursor,plotArea,dataArea,edge) cannot be parameterized, because it has dependencies to/from statements that will be extracted |