File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/PiePlot.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/PiePlot.java | |||
Method name: void drawLeftLabels(KeyedValues, Graphics2D, Rectangle2D, Rectangle2D, float, PiePlotState)
|
Method name: void drawRightLabels(KeyedValues, Graphics2D, Rectangle2D, Rectangle2D, float, PiePlotState)
|
|||
Number of AST nodes: 14 | Number of AST nodes: 14 | |||
1 | for (int i = 0; i < leftKeys.getItemCount(); i++) { ↵ | 1 | for (int i = 0; i < keys.getItemCount(); i++) {↵ | |
2 | String label = this.labelGenerator.generateSectionLabel(↵ | 2 | String label = this.labelGenerator.generateSectionLabel(↵ | |
3 | this.dataset, leftKeys.getKey(i));↵ | 3 | this.dataset, keys.getKey(i));↵ | |
4 | if (label != null) {↵ | 4 | if (label != null) {↵ | |
5 | TextBlock block = TextUtilities.createTextBlock(label, ↵ | 5 | TextBlock block = TextUtilities.createTextBlock(label, ↵ | |
6 | this.labelFont, this.labelPaint, maxLabelWidth, ↵ | 6 | this.labelFont, this.labelPaint, maxLabelWidth, ↵ | |
7 | new G2TextMeasurer(g2));↵ | 7 | new G2TextMeasurer(g2));↵ | |
8 | TextBox labelBox = new TextBox(block);↵ | 8 | TextBox labelBox = new TextBox(block);↵ | |
9 | labelBox.setBackgroundPaint(this.labelBackgroundPaint);↵ | 9 | labelBox.setBackgroundPaint(this.labelBackgroundPaint);↵ | |
10 | labelBox.setOutlinePaint(this.labelOutlinePaint);↵ | 10 | labelBox.setOutlinePaint(this.labelOutlinePaint);↵ | |
11 | labelBox.setOutlineStroke(this.labelOutlineStroke);↵ | 11 | labelBox.setOutlineStroke(this.labelOutlineStroke);↵ | |
12 | labelBox.setShadowPaint(this.labelShadowPaint);↵ | 12 | labelBox.setShadowPaint(this.labelShadowPaint);↵ | |
13 | labelBox.setInteriorGap(this.labelPadding);↵ | 13 | labelBox.setInteriorGap(this.labelPadding);↵ | |
14 | double theta = Math.toRadians(↵ | 14 | double theta = Math.toRadians(↵ | |
15 | leftKeys.getValue(i).doubleValue());↵ | 15 | keys.getValue(i).doubleValue());↵ | |
16 | double baseY = state.getPieCenterY() - Math.sin(theta) ↵ | 16 | double baseY = state.getPieCenterY() ↵ | |
17 | * verticalLinkRadius;↵ | 17 | - Math.sin(theta) * verticalLinkRadius;↵ | |
18 | double hh = labelBox.getHeight(g2);↵ | 18 | double hh = labelBox.getHeight(g2);↵ | |
19 | this.labelDistributor.addPieLabelRecord(new PieLabelRecord(↵ | 19 | this.labelDistributor.addPieLabelRecord(new PieLabelRecord(↵ | |
20 | leftKeys.getKey(i), theta, baseY, labelBox, hh,↵ | 20 | keys.getKey(i), theta, baseY, labelBox, hh,↵ | |
21 | lGap / 2.0 + lGap / 2.0 * -Math.cos(theta), 0.9 ↵ | 21 | lGap / 2.0 + lGap / 2.0 * Math.cos(theta), ↵ | |
22 | + getExplodePercent(leftKeys.getKey(i))));↵ | 22 | 0.9 + getExplodePercent(keys.getKey(i))));↵ | |
23 | }↵ | 23 | }↵ | |
24 | } | 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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 150 |
Number of mapped statements | 14 |
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) | 34.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4 | for (int i = 0; i < leftKeys.getItemCount(); i++) |
| 4 | for (int i = 0; i < keys.getItemCount(); i++) | ||||||||||||||||||
5 | String label = this.labelGenerator.generateSectionLabel(this.dataset, leftKeys.getKey(i)); |
| 5 | String label = this.labelGenerator.generateSectionLabel(this.dataset, keys.getKey(i)); | ||||||||||||||||||
6 | if (label != null) | 6 | if (label != null) | |||||||||||||||||||
7 | TextBlock block = TextUtilities.createTextBlock(label, this.labelFont, this.labelPaint, maxLabelWidth, new G2TextMeasurer(g2)); | 7 | TextBlock block = TextUtilities.createTextBlock(label, this.labelFont, this.labelPaint, maxLabelWidth, new G2TextMeasurer(g2)); | |||||||||||||||||||
8 | TextBox labelBox = new TextBox(block); | 8 | TextBox labelBox = new TextBox(block); | |||||||||||||||||||
9 | labelBox.setBackgroundPaint(this.labelBackgroundPaint); | 9 | labelBox.setBackgroundPaint(this.labelBackgroundPaint); | |||||||||||||||||||
10 | labelBox.setOutlinePaint(this.labelOutlinePaint); | 10 | labelBox.setOutlinePaint(this.labelOutlinePaint); | |||||||||||||||||||
11 | labelBox.setOutlineStroke(this.labelOutlineStroke); | 11 | labelBox.setOutlineStroke(this.labelOutlineStroke); | |||||||||||||||||||
12 | labelBox.setShadowPaint(this.labelShadowPaint); | 12 | labelBox.setShadowPaint(this.labelShadowPaint); | |||||||||||||||||||
13 | labelBox.setInteriorGap(this.labelPadding); | 13 | labelBox.setInteriorGap(this.labelPadding); | |||||||||||||||||||
14 | double theta = Math.toRadians(leftKeys.getValue(i).doubleValue()); |
| 14 | double theta = Math.toRadians(keys.getValue(i).doubleValue()); | ||||||||||||||||||
15 | double baseY = state.getPieCenterY() - Math.sin(theta) * verticalLinkRadius; | 15 | double baseY = state.getPieCenterY() - Math.sin(theta) * verticalLinkRadius; | |||||||||||||||||||
16 | double hh = labelBox.getHeight(g2); | 16 | double hh = labelBox.getHeight(g2); | |||||||||||||||||||
17 | this.labelDistributor.addPieLabelRecord(new PieLabelRecord(leftKeys.getKey(i), theta, baseY, labelBox, hh, lGap / 2.0 + lGap / 2.0 * -Math.cos(theta), 0.9 + getExplodePercent(leftKeys.getKey(i)))); |
| 17 | this.labelDistributor.addPieLabelRecord(new PieLabelRecord(keys.getKey(i), theta, baseY, labelBox, hh, lGap / 2.0 + lGap / 2.0 * Math.cos(theta), 0.9 + getExplodePercent(keys.getKey(i)))); |
Row | Violation |
---|---|
1 | Expression -Math.cos(theta) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression Math.cos(theta) cannot be parameterized, because it has dependencies to/from statements that will be extracted |