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 createStackedBarChart(String, String, String, CategoryDataset, PlotOrientation, boolean, boolean, boolean)
|
Method name: JFreeChart createAreaChart(String, String, String, CategoryDataset, PlotOrientation, boolean, boolean, boolean)
|
|||
Number of AST nodes: 13 | Number of AST nodes: 14 | |||
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 | CategoryAxis categoryAxis = new CategoryAxis(domainAxisLabel);↵ | 4 | CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel);↵ | |
5 | categoryAxis.setCategoryMargin(0.0);↵ | |||
5 | ValueAxis valueAxis = new NumberAxis(rangeAxisLabel);↵ | 6 | ValueAxis valueAxis = new NumberAxis(valueAxisLabel);↵ | |
6 | StackedBarRenderer renderer = new StackedBarRenderer();↵ | 7 | AreaRenderer renderer = new AreaRenderer();↵ | |
7 | if (tooltips) {↵ | 8 | if (tooltips) {↵ | |
8 | renderer.setBaseToolTipGenerator(↵ | 9 | renderer.setBaseToolTipGenerator(↵ | |
9 | new StandardCategoryToolTipGenerator());↵ | 10 | new StandardCategoryToolTipGenerator());↵ | |
10 | }↵ | 11 | }↵ | |
11 | if (urls) {↵ | 12 | if (urls) {↵ | |
12 | renderer.setBaseItemURLGenerator(↵ | 13 | renderer.setBaseItemURLGenerator(↵ | |
13 | new StandardCategoryURLGenerator());↵ | 14 | new StandardCategoryURLGenerator());↵ | |
14 | }↵ | 15 | }↵ | |
15 | CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, ↵ | 16 | CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, ↵ | |
16 | renderer);↵ | 17 | renderer);↵ | |
17 | plot.setOrientation(orientation);↵ | 18 | plot.setOrientation(orientation);↵ | |
18 | JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,↵ | 19 | JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,↵ | |
19 | plot, legend);↵ | 20 | plot, legend);↵ | |
20 | return chart; | 21 |
| |
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 | 39 |
Number of mapped statements | 13 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 57.8 |
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 | CategoryAxis categoryAxis = new CategoryAxis(domainAxisLabel); |
| 3 | CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel); | ||||||||||||||||||
|
| 4 | categoryAxis.setCategoryMargin(0.0); | |||||||||||||||||||
4 | ValueAxis valueAxis = new NumberAxis(rangeAxisLabel); |
| 5 | ValueAxis valueAxis = new NumberAxis(valueAxisLabel); | ||||||||||||||||||
5 | StackedBarRenderer renderer = new StackedBarRenderer(); |
| 6 | AreaRenderer renderer = new AreaRenderer(); | ||||||||||||||||||
6 | if (tooltips) | 7 | if (tooltips) | |||||||||||||||||||
7 | renderer.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator()); |
| 8 | renderer.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator()); | ||||||||||||||||||
8 | if (urls) | 9 | if (urls) | |||||||||||||||||||
9 | renderer.setBaseItemURLGenerator(new StandardCategoryURLGenerator()); |
| 10 | renderer.setBaseItemURLGenerator(new StandardCategoryURLGenerator()); | ||||||||||||||||||
10 | CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, renderer); |
| 11 | CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, renderer); | ||||||||||||||||||
11 | plot.setOrientation(orientation); | 12 | plot.setOrientation(orientation); | |||||||||||||||||||
12 | JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); | 13 | JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); | |||||||||||||||||||
13 | return chart; | 14 | return chart; |
Row | Violation |
---|---|
1 | Unmatched statement categoryAxis.setCategoryMargin(0.0); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Expression new StackedBarRenderer() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression new AreaRenderer() cannot be parameterized, because it has dependencies to/from statements that will be extracted |