File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/PiePlot3D.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/PiePlot3D.java | |||
Method name: void drawSide(Graphics2D, Rectangle2D, Arc2D, Area, Area, Paint, Paint, Stroke, boolean, boolean)
|
Method name: void drawSide(Graphics2D, Rectangle2D, Arc2D, Area, Area, Paint, Paint, Stroke, boolean, boolean)
|
|||
Number of AST nodes: 79 | Number of AST nodes: 80 | |||
1 | if (extent > 0.0) { // the pie sections are arranged ANTICLOCKWISE↵ | |||
1 | if (isAngleAtFront(start)) { // start at front↵ | 2 | if (isAngleAtFront(start)) { // segment starts at the front↵ | |
2 | if (!isAngleAtBack(end)) {↵ | 3 | if (!isAngleAtBack(end)) { // and finishes at the front↵ | |
3 | if (extent > -180.0) { // the segment is entirely at the ↵ | 4 | if (extent < 180.0) { // segment ↵ | |
4 | // front of the chart↵ | 5 | only occupies the front↵ | |
5 | if (drawFront) {↵ | 6 | if (drawFront) {↵ | |
6 | Area side = new Area(new Rectangle2D.Double(↵ | 7 | Area side = new Area(new Rectangle2D.Double(↵ | |
7 | arc.getEndPoint().getX(), plotArea.getY(), ↵ | 8 | arc.getStartPoint().getX(), plotArea.getY(),↵ | |
8 | arc.getStartPoint().getX() ↵ | 9 | arc.getEndPoint().getX() ↵ | |
9 | - arc.getEndPoint().getX(),↵ | 10 | - arc.getStartPoint().getX(),↵ | |
10 | plotArea.getHeight()));↵ | 11 | plotArea.getHeight()));↵ | |
11 | side.intersect(front);↵ | 12 | side.intersect(front);↵ | |
12 | g2.setPaint(paint);↵ | 13 | g2.setPaint(paint);↵ | |
13 | g2.fill(side);↵ | 14 | g2.fill(side);↵ | |
14 | g2.setPaint(outlinePaint);↵ | 15 | g2.setPaint(outlinePaint);↵ | |
15 | g2.draw(side);↵ | 16 | g2.draw(side);↵ | |
16 | }↵ | 17 | }↵ | |
17 | }↵ | 18 | }↵ | |
18 | else { // the segment starts at the front, and wraps all ↵ | 19 | else { // segment↵ | |
19 | // the way around↵ | |||
20 | // the back and finishes at the front again↵ | 20 | s wraps right around the back...↵ | |
21 | Area side1 = new Area(new Rectangle2D.Double(↵ | 21 | Area side1 = new Area(new Rectangle2D.Double(↵ | |
22 | plotArea.getX(), plotArea.getY(),↵ | 22 | arc.getStartPoint().getX(), plotArea.getY(),↵ | |
23 | arc.getStartPoint().getX() - plotArea.getX(), ↵ | 23 | plotArea.getMaxX() - arc.getStartPoint().getX(),↵ | |
24 | plotArea.getHeight()));↵ | 24 | plotArea.getHeight()));↵ | |
25 | side1.intersect(front);↵ | 25 | side1.intersect(front);↵ | |
26 | Area side2 = new Area(new Rectangle2D.Double(↵ | 26 | Area side2 = new Area(new Rectangle2D.Double(↵ | |
27 | arc.getEndPoint().getX(), plotArea.getY(),↵ | 27 | plotArea.getX(), plotArea.getY(),↵ | |
28 | plotArea.getMaxX() - arc.getEndPoint().getX(),↵ | 28 | arc.getEndPoint().getX() - plotArea.getX(),↵ | |
29 | plotArea.getHeight()));↵ | 29 | plotArea.getHeight()));↵ | |
30 | side2.intersect(front);↵ | 30 | side2.intersect(front);↵ | |
31 | g2.setPaint(paint);↵ | 31 | g2.setPaint(paint);↵ | |
32 | if (drawFront) {↵ | 32 | if (drawFront) {↵ | |
33 | g2.fill(side1);↵ | 33 | g2.fill(side1);↵ | |
34 | g2.fill(side2);↵ | 34 | g2.fill(side2);↵ | |
35 | }↵ | 35 | }↵ | |
36 | if (drawBack) {↵ | 36 | if (drawBack) {↵ | |
37 | g2.fill(back);↵ | 37 | g2.fill(back);↵ | |
38 | }↵ | 38 | }↵ | |
39 | g2.setPaint(outlinePaint);↵ | 39 | g2.setPaint(outlinePaint);↵ | |
40 | if (drawFront) {↵ | 40 | if (drawFront) {↵ | |
41 | g2.draw(side1);↵ | 41 | g2.draw(side1);↵ | |
42 | g2.draw(side2);↵ | 42 | g2.draw(side2);↵ | |
43 | }↵ | 43 | }↵ | |
44 | if (drawBack) {↵ | 44 | if (drawBack) {↵ | |
45 | g2.draw(back);↵ | 45 | g2.draw(back);↵ | |
46 | }↵ | 46 | }↵ | |
47 | }↵ | 47 | }↵ | |
48 | }↵ | 48 | }↵ | |
49 | else { // starts at the front, finishes at the back (going ↵ | 49 | else { // segments starts at front and finishes at ↵ | |
50 | // around the left side)↵ | |||
50 | back...↵ | |||
51 | if (drawBack) {↵ | 51 | if (drawBack) {↵ | |
52 | Area side2 = new Area(new Rectangle2D.Double(↵ | 52 | Area side2 = new Area(new Rectangle2D.Double(↵ | |
53 | plotArea.getX(), plotArea.getY(),↵ | 53 | arc.getEndPoint().getX(), plotArea.getY(),↵ | |
54 | arc.getEndPoint().getX() - plotArea.getX(), ↵ | 54 | plotArea.getMaxX() - arc.getEndPoint().getX(),↵ | |
55 | plotArea.getHeight()));↵ | 55 | plotArea.getHeight()));↵ | |
56 | side2.intersect(back);↵ | 56 | side2.intersect(back);↵ | |
57 | g2.setPaint(paint);↵ | 57 | g2.setPaint(paint);↵ | |
58 | g2.fill(side2);↵ | 58 | g2.fill(side2);↵ | |
59 | g2.setPaint(outlinePaint);↵ | 59 | g2.setPaint(outlinePaint);↵ | |
60 | g2.draw(side2);↵ | 60 | g2.draw(side2);↵ | |
61 | }↵ | 61 | }↵ | |
62 | if (drawFront) {↵ | 62 | if (drawFront) {↵ | |
63 | Area side1 = new Area(new Rectangle2D.Double(↵ | 63 | Area side1 = new Area(new Rectangle2D.Double(↵ | |
64 | plotArea.getX(), plotArea.getY(),↵ | 64 | arc.getStartPoint().getX(), plotArea.getY(),↵ | |
65 | arc.getStartPoint().getX() - plotArea.getX(),↵ | 65 | plotArea.getMaxX() - arc.getStartPoint().getX(),↵ | |
66 | plotArea.getHeight()));↵ | 66 | plotArea.getHeight()));↵ | |
67 | side1.intersect(front);↵ | 67 | side1.intersect(front);↵ | |
68 | g2.setPaint(paint);↵ | 68 | g2.setPaint(paint);↵ | |
69 | g2.fill(side1);↵ | 69 | g2.fill(side1);↵ | |
70 | g2.setPaint(outlinePaint);↵ | 70 | g2.setPaint(outlinePaint);↵ | |
71 | g2.draw(side1);↵ | 71 | g2.draw(side1);↵ | |
72 | }↵ | 72 | }↵ | |
73 | }↵ | 73 | }↵ | |
74 | }↵ | 74 | }↵ | |
75 | else { // the segment starts at the back (still extending ↵ | 75 | else { // segment starts at ↵ | |
76 | // CLOCKWISE)↵ | 76 | back↵ | |
77 | if (!isAngleAtFront(end)) {↵ | 77 | if (!isAngleAtFront(end)) {↵ | |
78 | if (extent > -180.0) { // whole segment stays at the back↵ | 78 | if (extent < 180.0) { // and finishes at back↵ | |
79 | if (drawBack) {↵ | 79 | if (drawBack) {↵ | |
80 | Area side = new Area(new Rectangle2D.Double(↵ | 80 | Area side = new Area(new Rectangle2D.Double(↵ | |
81 | arc.getStartPoint().getX(), plotArea.getY(),↵ | 81 | arc.getEndPoint().getX(), plotArea.getY(),↵ | |
82 | arc.getEndPoint().getX() ↵ | 82 | arc.getStartPoint().getX() ↵ | |
83 | - arc.getStartPoint().getX(),↵ | 83 | - arc.getEndPoint().getX(),↵ | |
84 | plotArea.getHeight()));↵ | 84 | plotArea.getHeight()));↵ | |
85 | side.intersect(back);↵ | 85 | side.intersect(back);↵ | |
86 | g2.setPaint(paint);↵ | 86 | g2.setPaint(paint);↵ | |
87 | g2.fill(side);↵ | 87 | g2.fill(side);↵ | |
88 | g2.setPaint(outlinePaint);↵ | 88 | g2.setPaint(outlinePaint);↵ | |
89 | g2.draw(side);↵ | 89 | g2.draw(side);↵ | |
90 | }↵ | 90 | }↵ | |
91 | }↵ | 91 | }↵ | |
92 | else { // starts at the back, wraps around front, and ↵ | 92 | else { // starts at back and wraps right around to the ↵ | |
93 | // finishes at back again↵ | 93 | // back again↵ | |
94 | Area side1 = new Area(new Rectangle2D.Double(↵ | 94 | Area side1 = new Area(new Rectangle2D.Double(↵ | |
95 | arc.getStartPoint().getX(), plotArea.getY(),↵ | 95 | arc.getStartPoint().getX(), plotArea.getY(),↵ | |
96 | plotArea.getMaxX() - arc.getStartPoint().getX(),↵ | 96 | plotArea.getX() - arc.getStartPoint().getX(),↵ | |
97 | plotArea.getHeight()));↵ | 97 | plotArea.getHeight()));↵ | |
98 | side1.intersect(back);↵ | 98 | side1.intersect(back);↵ | |
99 | Area side2 = new Area(new Rectangle2D.Double(↵ | 99 | Area side2 = new Area(new Rectangle2D.Double(↵ | |
100 | plotArea.getX(), plotArea.getY(),↵ | 100 | arc.getEndPoint().getX(), plotArea.getY(),↵ | |
101 | arc.getEndPoint().getX() - plotArea.getX(),↵ | 101 | plotArea.getMaxX() - arc.getEndPoint().getX(),↵ | |
102 | plotArea.getHeight()));↵ | 102 | plotArea.getHeight()));↵ | |
103 | side2.intersect(back);↵ | 103 | side2.intersect(back);↵ | |
104 | g2.setPaint(paint);↵ | 104 | g2.setPaint(paint);↵ | |
105 | if (drawBack) {↵ | 105 | if (drawBack) {↵ | |
106 | g2.fill(side1);↵ | 106 | g2.fill(side1);↵ | |
107 | g2.fill(side2);↵ | 107 | g2.fill(side2);↵ | |
108 | }↵ | 108 | }↵ | |
109 | if (drawFront) {↵ | 109 | if (drawFront) {↵ | |
110 | g2.fill(front);↵ | 110 | g2.fill(front);↵ | |
111 | }↵ | 111 | }↵ | |
112 | g2.setPaint(outlinePaint);↵ | 112 | g2.setPaint(outlinePaint);↵ | |
113 | if (drawBack) {↵ | 113 | if (drawBack) {↵ | |
114 | g2.draw(side1);↵ | 114 | g2.draw(side1);↵ | |
115 | g2.draw(side2);↵ | 115 | g2.draw(side2);↵ | |
116 | }↵ | 116 | }↵ | |
117 | if (drawFront) {↵ | 117 | if (drawFront) {↵ | |
118 | g2.draw(front);↵ | 118 | g2.draw(front);↵ | |
119 | }↵ | 119 | }↵ | |
120 | }↵ | 120 | }↵ | |
121 | }↵ | 121 | }↵ | |
122 | else { // starts at back, finishes at front (CLOCKWISE)↵ | 122 | else { // starts at the back and finishes at the front ↵ | |
123 | // (wrapping the left side)↵ | |||
123 | if (drawBack) {↵ | 124 | if (drawBack) {↵ | |
124 | Area side1 = new Area(new Rectangle2D.Double(↵ | 125 | Area side1 = new Area(new Rectangle2D.Double(↵ | |
125 | arc.getStartPoint().getX(), plotArea.getY(),↵ | 126 | plotArea.getX(), plotArea.getY(),↵ | |
126 | plotArea.getMaxX() - arc.getStartPoint().getX(),↵ | 127 | arc.getStartPoint().getX() - plotArea.getX(),↵ | |
127 | plotArea.getHeight()));↵ | 128 | plotArea.getHeight()));↵ | |
128 | side1.intersect(back);↵ | 129 | side1.intersect(back);↵ | |
129 | g2.setPaint(paint);↵ | 130 | g2.setPaint(paint);↵ | |
130 | g2.fill(side1);↵ | 131 | g2.fill(side1);↵ | |
131 | g2.setPaint(outlinePaint);↵ | 132 | g2.setPaint(outlinePaint);↵ | |
132 | g2.draw(side1);↵ | 133 | g2.draw(side1);↵ | |
133 | }↵ | 134 | }↵ | |
134 | if (drawFront) {↵ | 135 | if (drawFront) {↵ | |
135 | Area side2 = new Area(new Rectangle2D.Double(↵ | 136 | Area side2 = new Area(new Rectangle2D.Double(↵ | |
136 | arc.getEndPoint().getX(), plotArea.getY(),↵ | 137 | plotArea.getX(), plotArea.getY(),↵ | |
137 | plotArea.getMaxX() - arc.getEndPoint().getX(),↵ | 138 | arc.getEndPoint().getX() - plotArea.getX(),↵ | |
138 | plotArea.getHeight()));↵ | 139 | plotArea.getHeight()));↵ | |
139 | side2.intersect(front);↵ | 140 | side2.intersect(front);↵ | |
140 | g2.setPaint(paint);↵ | 141 | g2.setPaint(paint);↵ | |
141 | g2.fill(side2);↵ | 142 | g2.fill(side2);↵ | |
142 | g2.setPaint(outlinePaint);↵ | 143 | g2.setPaint(outlinePaint);↵ | |
143 | g2.draw(side2);↵ | 144 | g2.draw(side2);↵ | |
144 | }↵ | 145 | }↵ | |
145 | }↵ | 146 | }↵ | |
146 | } | 147 | }↵ | |
148 |
| |||
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 10 |
Number of refactorable cases | 5 |
Number of non-refactorable cases | 5 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 21.5 |
Clones location | Clones are in the same method |
Number of node comparisons | 540 |
Number of mapped statements | 7 |
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) | 29.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
14 | if (drawFront) | 94 | if (drawFront) | |||||||||||||||||
15 | Area side = new Area(new Rectangle2D.Double(arc.getEndPoint().getX(), plotArea.getY(), arc.getStartPoint().getX() - arc.getEndPoint().getX(), plotArea.getHeight())); |
| 95 | Area side = new Area(new Rectangle2D.Double(arc.getStartPoint().getX(), plotArea.getY(), arc.getEndPoint().getX() - arc.getStartPoint().getX(), plotArea.getHeight())); | ||||||||||||||||
16 | side.intersect(front); | 96 | side.intersect(front); | |||||||||||||||||
17 | g2.setPaint(paint); | 97 | g2.setPaint(paint); | |||||||||||||||||
18 | g2.fill(side); | 98 | g2.fill(side); | |||||||||||||||||
19 | g2.setPaint(outlinePaint); | 99 | g2.setPaint(outlinePaint); | |||||||||||||||||
20 | g2.draw(side); | 100 | g2.draw(side); |
Row | Violation |
---|
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 10.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
44 | if (drawFront) | 94 | if (drawFront) | |||||||||||
45 | Area side1 = new Area(new Rectangle2D.Double(plotArea.getX(), plotArea.getY(), arc.getStartPoint().getX() - plotArea.getX(), plotArea.getHeight())); | | ||||||||||||
| 95 | Area side = new Area(new Rectangle2D.Double(arc.getStartPoint().getX(), plotArea.getY(), arc.getEndPoint().getX() - arc.getStartPoint().getX(), plotArea.getHeight())); | ||||||||||||
46 | side1.intersect(front); |
| 96 | side.intersect(front); | ||||||||||
47 | g2.setPaint(paint); | 97 | g2.setPaint(paint); | |||||||||||
48 | g2.fill(side1); |
| 98 | g2.fill(side); | ||||||||||
49 | g2.setPaint(outlinePaint); | 99 | g2.setPaint(outlinePaint); | |||||||||||
50 | g2.draw(side1); |
| 100 | g2.draw(side); |
Row | Violation |
---|
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 5 |
Number of unmapped statements in the second code fragment | 8 |
Time elapsed for statement mapping (ms) | 4.2 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 101 | Area side1 = new Area(new Rectangle2D.Double(arc.getStartPoint().getX(), plotArea.getY(), plotArea.getMaxX() - arc.getStartPoint().getX(), plotArea.getHeight())); | ||||||||||||
| 102 | side1.intersect(front); | ||||||||||||
| 103 | Area side2 = new Area(new Rectangle2D.Double(plotArea.getX(), plotArea.getY(), arc.getEndPoint().getX() - plotArea.getX(), plotArea.getHeight())); | ||||||||||||
| 104 | side2.intersect(front); | ||||||||||||
| 105 | g2.setPaint(paint); | ||||||||||||
| 106 | if (drawFront) | ||||||||||||
| 107 | g2.fill(side1); | ||||||||||||
| 108 | g2.fill(side2); | ||||||||||||
53 | if (drawBack) | 109 | if (drawBack) | |||||||||||
54 | Area side = new Area(new Rectangle2D.Double(arc.getStartPoint().getX(), plotArea.getY(), arc.getEndPoint().getX() - arc.getStartPoint().getX(), plotArea.getHeight())); | | ||||||||||||
55 | side.intersect(back); | | ||||||||||||
56 | g2.setPaint(paint); | | ||||||||||||
57 | g2.fill(side); |
| 110 | g2.fill(back); | ||||||||||
58 | g2.setPaint(outlinePaint); | | ||||||||||||
59 | g2.draw(side); | |
Row | Violation |
---|
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 8 |
Number of unmapped statements in the second code fragment | 5 |
Time elapsed for statement mapping (ms) | 3.4 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
60 | Area side1 = new Area(new Rectangle2D.Double(arc.getStartPoint().getX(), plotArea.getY(), plotArea.getMaxX() - arc.getStartPoint().getX(), plotArea.getHeight())); | | ||||||||||||
61 | side1.intersect(back); | | ||||||||||||
62 | Area side2 = new Area(new Rectangle2D.Double(plotArea.getX(), plotArea.getY(), arc.getEndPoint().getX() - plotArea.getX(), plotArea.getHeight())); | | ||||||||||||
63 | side2.intersect(back); | | ||||||||||||
64 | g2.setPaint(paint); | | ||||||||||||
65 | if (drawBack) | | ||||||||||||
66 | g2.fill(side1); | | ||||||||||||
67 | g2.fill(side2); | | ||||||||||||
68 | if (drawFront) | 94 | if (drawFront) | |||||||||||
| 95 | Area side = new Area(new Rectangle2D.Double(arc.getStartPoint().getX(), plotArea.getY(), arc.getEndPoint().getX() - arc.getStartPoint().getX(), plotArea.getHeight())); | ||||||||||||
| 96 | side.intersect(front); | ||||||||||||
| 97 | g2.setPaint(paint); | ||||||||||||
69 | g2.fill(front); |
| 98 | g2.fill(side); | ||||||||||
| 99 | g2.setPaint(outlinePaint); | ||||||||||||
| 100 | g2.draw(side); |
Row | Violation |
---|
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 8.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
83 | if (drawFront) | 94 | if (drawFront) | |||||||||||
84 | Area side2 = new Area(new Rectangle2D.Double(arc.getEndPoint().getX(), plotArea.getY(), plotArea.getMaxX() - arc.getEndPoint().getX(), plotArea.getHeight())); | | ||||||||||||
| 95 | Area side = new Area(new Rectangle2D.Double(arc.getStartPoint().getX(), plotArea.getY(), arc.getEndPoint().getX() - arc.getStartPoint().getX(), plotArea.getHeight())); | ||||||||||||
85 | side2.intersect(front); |
| 96 | side.intersect(front); | ||||||||||
86 | g2.setPaint(paint); | 97 | g2.setPaint(paint); | |||||||||||
87 | g2.fill(side2); |
| 98 | g2.fill(side); | ||||||||||
88 | g2.setPaint(outlinePaint); | 99 | g2.setPaint(outlinePaint); | |||||||||||
89 | g2.draw(side2); |
| 100 | g2.draw(side); |
Row | Violation |
---|
Number of mapped statements | 3 |
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) | 38.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
21 | Area side1 = new Area(new Rectangle2D.Double(plotArea.getX(), plotArea.getY(), arc.getStartPoint().getX() - plotArea.getX(), plotArea.getHeight())); | | |||||||||||||||||
22 | side1.intersect(front); | | |||||||||||||||||
23 | Area side2 = new Area(new Rectangle2D.Double(arc.getEndPoint().getX(), plotArea.getY(), plotArea.getMaxX() - arc.getEndPoint().getX(), plotArea.getHeight())); | | |||||||||||||||||
24 | side2.intersect(front); | | |||||||||||||||||
25 | g2.setPaint(paint); | | |||||||||||||||||
26 | if (drawFront) | 94 | if (drawFront) | ||||||||||||||||
| 95 | Area side = new Area(new Rectangle2D.Double(arc.getStartPoint().getX(), plotArea.getY(), arc.getEndPoint().getX() - arc.getStartPoint().getX(), plotArea.getHeight())); | |||||||||||||||||
| 96 | side.intersect(front); | |||||||||||||||||
| 97 | g2.setPaint(paint); | |||||||||||||||||
| 99 | g2.setPaint(outlinePaint); | |||||||||||||||||
27 | g2.fill(side1); |
| 100 | g2.draw(side); | |||||||||||||||
28 | g2.fill(side2); |
| 98 | g2.fill(side); |
Row | Violation |
---|---|
1 | Expression g2.fill(side1) is a void method call, and thus it cannot be parameterized |
2 | Expression g2.draw(side) is a void method call, and thus it cannot be parameterized |
Number of mapped statements | 9 |
Number of unmapped statements in the first code fragment | 7 |
Number of unmapped statements in the second code fragment | 7 |
Time elapsed for statement mapping (ms) | 16.8 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
21 | Area side1 = new Area(new Rectangle2D.Double(plotArea.getX(), plotArea.getY(), arc.getStartPoint().getX() - plotArea.getX(), plotArea.getHeight())); |
| 103 | Area side2 = new Area(new Rectangle2D.Double(plotArea.getX(), plotArea.getY(), arc.getEndPoint().getX() - plotArea.getX(), plotArea.getHeight())); | ||||||||||||||||
22 | side1.intersect(front); |
| 104 | side2.intersect(front); | ||||||||||||||||
23 | Area side2 = new Area(new Rectangle2D.Double(arc.getEndPoint().getX(), plotArea.getY(), plotArea.getMaxX() - arc.getEndPoint().getX(), plotArea.getHeight())); |
| 101 | Area side1 = new Area(new Rectangle2D.Double(arc.getStartPoint().getX(), plotArea.getY(), plotArea.getMaxX() - arc.getStartPoint().getX(), plotArea.getHeight())); | ||||||||||||||||
24 | side2.intersect(front); |
| 102 | side1.intersect(front); | ||||||||||||||||
25 | g2.setPaint(paint); | 105 | g2.setPaint(paint); | |||||||||||||||||
26 | if (drawFront) | 106 | if (drawFront) | |||||||||||||||||
27 | g2.fill(side1); | 107 | g2.fill(side1); | |||||||||||||||||
28 | g2.fill(side2); | 108 | g2.fill(side2); | |||||||||||||||||
29 | if (drawBack) | | ||||||||||||||||||
30 | g2.fill(back); | | ||||||||||||||||||
| 109 | if (drawBack) | ||||||||||||||||||
| 110 | g2.fill(back); | ||||||||||||||||||
31 | g2.setPaint(outlinePaint); | 111 | g2.setPaint(outlinePaint); | |||||||||||||||||
32 | if (drawFront) | | ||||||||||||||||||
33 | g2.draw(side1); | | ||||||||||||||||||
34 | g2.draw(side2); | | ||||||||||||||||||
35 | if (drawBack) | | ||||||||||||||||||
36 | g2.draw(back); | | ||||||||||||||||||
| 112 | if (drawFront) | ||||||||||||||||||
| 113 | g2.draw(side1); | ||||||||||||||||||
| 114 | g2.draw(side2); | ||||||||||||||||||
| 115 | if (drawBack) | ||||||||||||||||||
| 116 | g2.draw(back); |
Row | Violation |
---|---|
1 | Expression side1 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression side2 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression side2 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression side1 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Clone fragment #1 returns variables side1, side2 , while Clone fragment #2 returns variables side1, side2 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 11 |
Number of unmapped statements in the second code fragment | 7 |
Time elapsed for statement mapping (ms) | 8.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 101 | Area side1 = new Area(new Rectangle2D.Double(arc.getStartPoint().getX(), plotArea.getY(), plotArea.getMaxX() - arc.getStartPoint().getX(), plotArea.getHeight())); | |||||||||||||||||
| 102 | side1.intersect(front); | |||||||||||||||||
| 103 | Area side2 = new Area(new Rectangle2D.Double(plotArea.getX(), plotArea.getY(), arc.getEndPoint().getX() - plotArea.getX(), plotArea.getHeight())); | |||||||||||||||||
| 104 | side2.intersect(front); | |||||||||||||||||
| 105 | g2.setPaint(paint); | |||||||||||||||||
37 | if (drawBack) |
| 106 | if (drawFront) | |||||||||||||||
38 | Area side2 = new Area(new Rectangle2D.Double(plotArea.getX(), plotArea.getY(), arc.getEndPoint().getX() - plotArea.getX(), plotArea.getHeight())); | | |||||||||||||||||
39 | side2.intersect(back); | | |||||||||||||||||
40 | g2.setPaint(paint); | | |||||||||||||||||
41 | g2.fill(side2); | 108 | g2.fill(side2); | ||||||||||||||||
42 | g2.setPaint(outlinePaint); | | |||||||||||||||||
43 | g2.draw(side2); |
| 107 | g2.fill(side1); | |||||||||||||||
44 | if (drawFront) | | |||||||||||||||||
45 | Area side1 = new Area(new Rectangle2D.Double(plotArea.getX(), plotArea.getY(), arc.getStartPoint().getX() - plotArea.getX(), plotArea.getHeight())); | | |||||||||||||||||
46 | side1.intersect(front); | | |||||||||||||||||
47 | g2.setPaint(paint); | | |||||||||||||||||
48 | g2.fill(side1); | | |||||||||||||||||
49 | g2.setPaint(outlinePaint); | | |||||||||||||||||
50 | g2.draw(side1); | | |||||||||||||||||
| 109 | if (drawBack) | |||||||||||||||||
| 110 | g2.fill(back); |
Row | Violation |
---|---|
1 | Expression g2.draw(side2) is a void method call, and thus it cannot be parameterized |
2 | Expression g2.fill(side1) is a void method call, and thus it cannot be parameterized |
Number of mapped statements | 9 |
Number of unmapped statements in the first code fragment | 7 |
Number of unmapped statements in the second code fragment | 7 |
Time elapsed for statement mapping (ms) | 13.3 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
60 | Area side1 = new Area(new Rectangle2D.Double(arc.getStartPoint().getX(), plotArea.getY(), plotArea.getMaxX() - arc.getStartPoint().getX(), plotArea.getHeight())); | 101 | Area side1 = new Area(new Rectangle2D.Double(arc.getStartPoint().getX(), plotArea.getY(), plotArea.getMaxX() - arc.getStartPoint().getX(), plotArea.getHeight())); | |||||||||||
61 | side1.intersect(back); |
| 102 | side1.intersect(front); | ||||||||||
62 | Area side2 = new Area(new Rectangle2D.Double(plotArea.getX(), plotArea.getY(), arc.getEndPoint().getX() - plotArea.getX(), plotArea.getHeight())); | 103 | Area side2 = new Area(new Rectangle2D.Double(plotArea.getX(), plotArea.getY(), arc.getEndPoint().getX() - plotArea.getX(), plotArea.getHeight())); | |||||||||||
63 | side2.intersect(back); |
| 104 | side2.intersect(front); | ||||||||||
64 | g2.setPaint(paint); | 105 | g2.setPaint(paint); | |||||||||||
65 | if (drawBack) |
| 106 | if (drawFront) | ||||||||||
66 | g2.fill(side1); | 107 | g2.fill(side1); | |||||||||||
67 | g2.fill(side2); | 108 | g2.fill(side2); | |||||||||||
68 | if (drawFront) | | ||||||||||||
69 | g2.fill(front); | | ||||||||||||
| 109 | if (drawBack) | ||||||||||||
| 110 | g2.fill(back); | ||||||||||||
70 | g2.setPaint(outlinePaint); | 111 | g2.setPaint(outlinePaint); | |||||||||||
71 | if (drawBack) | | ||||||||||||
72 | g2.draw(side1); | | ||||||||||||
73 | g2.draw(side2); | | ||||||||||||
74 | if (drawFront) | | ||||||||||||
75 | g2.draw(front); | | ||||||||||||
| 112 | if (drawFront) | ||||||||||||
| 113 | g2.draw(side1); | ||||||||||||
| 114 | g2.draw(side2); | ||||||||||||
| 115 | if (drawBack) | ||||||||||||
| 116 | g2.draw(back); |
Row | Violation |
---|---|
1 | Clone fragment #1 returns variables side1, side2 , while Clone fragment #2 returns variables side1, side2 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 11 |
Number of unmapped statements in the second code fragment | 7 |
Time elapsed for statement mapping (ms) | 8.5 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 101 | Area side1 = new Area(new Rectangle2D.Double(arc.getStartPoint().getX(), plotArea.getY(), plotArea.getMaxX() - arc.getStartPoint().getX(), plotArea.getHeight())); | |||||||||||||||||
| 102 | side1.intersect(front); | |||||||||||||||||
| 103 | Area side2 = new Area(new Rectangle2D.Double(plotArea.getX(), plotArea.getY(), arc.getEndPoint().getX() - plotArea.getX(), plotArea.getHeight())); | |||||||||||||||||
| 104 | side2.intersect(front); | |||||||||||||||||
| 105 | g2.setPaint(paint); | |||||||||||||||||
76 | if (drawBack) |
| 106 | if (drawFront) | |||||||||||||||
77 | Area side1 = new Area(new Rectangle2D.Double(arc.getStartPoint().getX(), plotArea.getY(), plotArea.getMaxX() - arc.getStartPoint().getX(), plotArea.getHeight())); | | |||||||||||||||||
78 | side1.intersect(back); | | |||||||||||||||||
79 | g2.setPaint(paint); | | |||||||||||||||||
80 | g2.fill(side1); | 107 | g2.fill(side1); | ||||||||||||||||
81 | g2.setPaint(outlinePaint); | | |||||||||||||||||
82 | g2.draw(side1); |
| 108 | g2.fill(side2); | |||||||||||||||
83 | if (drawFront) | | |||||||||||||||||
84 | Area side2 = new Area(new Rectangle2D.Double(arc.getEndPoint().getX(), plotArea.getY(), plotArea.getMaxX() - arc.getEndPoint().getX(), plotArea.getHeight())); | | |||||||||||||||||
85 | side2.intersect(front); | | |||||||||||||||||
86 | g2.setPaint(paint); | | |||||||||||||||||
87 | g2.fill(side2); | | |||||||||||||||||
88 | g2.setPaint(outlinePaint); | | |||||||||||||||||
89 | g2.draw(side2); | | |||||||||||||||||
| 109 | if (drawBack) | |||||||||||||||||
| 110 | g2.fill(back); |
Row | Violation |
---|---|
1 | Expression g2.draw(side1) is a void method call, and thus it cannot be parameterized |
2 | Expression g2.fill(side2) is a void method call, and thus it cannot be parameterized |