File path: /jfreechart-1.0.10/src/org/jfree/chart/ChartFactory.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/ChartFactory.java | |||
Method name: JFreeChart createScatterPlot(String, String, String, XYDataset, PlotOrientation, boolean, boolean, boolean)
|
Method name: JFreeChart createXYStepChart(String, String, String, XYDataset, PlotOrientation, boolean, boolean, boolean)
|
|||
Number of AST nodes: 20 | Number of AST nodes: 19 | |||
1 | if (orientation == null) {↵ | 1 | if (orientation == null) {↵ | |
2 | throw new IllegalArgumentException("Null 'orientation' argument.");↵ | 2 | throw new IllegalArgumentException("Null 'orientation' argument.");↵ | |
3 | }↵ | 3 | }↵ | |
4 | NumberAxis xAxis = new NumberAxis(xAxisLabel);↵ | 4 | DateAxis xAxis = new DateAxis(xAxisLabel);↵ | |
5 | xAxis.setAutoRangeIncludesZero(false);↵ | |||
6 | NumberAxis yAxis = new NumberAxis(yAxisLabel);↵ | 5 | NumberAxis yAxis = new NumberAxis(yAxisLabel);↵ | |
7 | yAxis.setAutoRangeIncludesZero(false);↵ | 6 | yAxis.set↵ | |
8 | XYPlot plot = new XYPlot(dataset, xAxis, yAxis, null);↵ | 7 | StandardTickUnits(NumberAxis.createIntegerTickUnits());↵ | |
9 | XYToolTipGenerator toolTipGenerator = null;↵ | 8 | XYToolTipGenerator toolTipGenerator = null;↵ | |
10 | if (tooltips) {↵ | 9 | if (tooltips) {↵ | |
11 | toolTipGenerator = new StandardXYToolTipGenerator();↵ | 10 | toolTipGenerator = new StandardXYToolTipGenerator();↵ | |
12 | }↵ | 11 | }↵ | |
13 | XYURLGenerator urlGenerator = null;↵ | 12 | XYURLGenerator urlGenerator = null;↵ | |
14 | if (urls) {↵ | 13 | if (urls) {↵ | |
15 | urlGenerator = new StandardXYURLGenerator();↵ | 14 | urlGenerator = new StandardXYURLGenerator();↵ | |
16 | }↵ | 15 | }↵ | |
17 | XYItemRenderer renderer = new XYLineAndShapeRenderer(false, true);↵ | 16 | XYItemRenderer renderer ↵ | |
18 | renderer.setBaseT↵ | |||
19 | oolTipGenerator(toolTipGenerator);↵ | 17 | = new XYStepRenderer(toolTipGenerator, urlGenerator);↵ | |
20 | renderer.setURLGenerator(urlGenerator);↵ | 18 | XYPlot plot = new XYPlot(dataset, xAxis, yAxis, null);↵ | |
21 | plot.setRenderer(renderer);↵ | 19 | plot.setRenderer(renderer);↵ | |
22 | plot.setOrientation(orientation);↵ | 20 | plot.setOrientation(orientation);↵ | |
21 | plot.setDomainCrosshairVisible(false);↵ | |||
22 | plot.setRangeCrosshairVisible(false);↵ | |||
23 | JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,↵ | 23 | JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,↵ | |
24 | plot, legend);↵ | 24 | plot, legend);↵ | |
25 | return chart; | 25 |
| |
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 114 |
Number of mapped statements | 15 |
Number of unmapped statements in the first code fragment | 5 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 58.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (orientation == null) | 1 | if (orientation == null) | |||||||||||||||||||
2 | throw new IllegalArgumentException("Null 'orientation' argument."); | 2 | throw new IllegalArgumentException("Null 'orientation' argument."); | |||||||||||||||||||
3 | NumberAxis xAxis = new NumberAxis(xAxisLabel); |
| 3 | DateAxis xAxis = new DateAxis(xAxisLabel); | ||||||||||||||||||
4 | xAxis.setAutoRangeIncludesZero(false); |
| | |||||||||||||||||||
5 | NumberAxis yAxis = new NumberAxis(yAxisLabel); | 4 | NumberAxis yAxis = new NumberAxis(yAxisLabel); | |||||||||||||||||||
|
| 5 | yAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); | |||||||||||||||||||
6 | yAxis.setAutoRangeIncludesZero(false); |
| | |||||||||||||||||||
7 | XYPlot plot = new XYPlot(dataset, xAxis, yAxis, null); |
| 13 | XYPlot plot = new XYPlot(dataset, xAxis, yAxis, null); | ||||||||||||||||||
8 | XYToolTipGenerator toolTipGenerator = null; | 6 | XYToolTipGenerator toolTipGenerator = null; | |||||||||||||||||||
9 | if (tooltips) | 7 | if (tooltips) | |||||||||||||||||||
10 | toolTipGenerator = new StandardXYToolTipGenerator(); | 8 | toolTipGenerator = new StandardXYToolTipGenerator(); | |||||||||||||||||||
11 | XYURLGenerator urlGenerator = null; | 9 | XYURLGenerator urlGenerator = null; | |||||||||||||||||||
12 | if (urls) | 10 | if (urls) | |||||||||||||||||||
13 | urlGenerator = new StandardXYURLGenerator(); | 11 | urlGenerator = new StandardXYURLGenerator(); | |||||||||||||||||||
|
| 12 | XYItemRenderer renderer = new XYStepRenderer(toolTipGenerator, urlGenerator); | |||||||||||||||||||
14 | XYItemRenderer renderer = new XYLineAndShapeRenderer(false, true); |
| | |||||||||||||||||||
15 | renderer.setBaseToolTipGenerator(toolTipGenerator); |
| | |||||||||||||||||||
16 | renderer.setURLGenerator(urlGenerator); |
| | |||||||||||||||||||
17 | plot.setRenderer(renderer); | 14 | plot.setRenderer(renderer); | |||||||||||||||||||
18 | plot.setOrientation(orientation); | 15 | plot.setOrientation(orientation); | |||||||||||||||||||
|
| 16 | plot.setDomainCrosshairVisible(false); | |||||||||||||||||||
|
| 17 | plot.setRangeCrosshairVisible(false); | |||||||||||||||||||
19 | JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); | 18 | JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); | |||||||||||||||||||
20 | return chart; | 19 | return chart; |
Row | Violation |
---|---|
1 | Expression new NumberAxis(xAxisLabel) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression new DateAxis(xAxisLabel) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement xAxis.setAutoRangeIncludesZero(false); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement yAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement yAxis.setAutoRangeIncludesZero(false); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Unmatched statement XYItemRenderer renderer=new XYStepRenderer(toolTipGenerator,urlGenerator); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Unmatched statement XYItemRenderer renderer=new XYLineAndShapeRenderer(false,true); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
8 | Unmatched statement renderer.setBaseToolTipGenerator(toolTipGenerator); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
9 | Unmatched statement renderer.setURLGenerator(urlGenerator); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
10 | Unmatched statement plot.setDomainCrosshairVisible(false); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
11 | Unmatched statement plot.setRangeCrosshairVisible(false); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |