example.turtlelogo.Circle   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 23
c 0
b 0
f 0
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A main(String[]) 0 20 2
1
package example.turtlelogo;
2
3
import org.gannacademy.cdf.turtlelogo.Turtle;
4
5
import java.awt.*;
6
7
public class Circle {
8
  private static Turtle donatello;
0 ignored issues
show
Comprehensibility Code Smell introduced by
Remove the "donatello" field and declare it as a local variable in the relevant methods.
Loading history...
9
10
  public static void main(String[] args) {
11
    donatello = new Turtle();
12
    donatello.getTerrarium().setSize(500, 500);
13
    donatello.tp(donatello.getTerrarium().getWidth() / 2, donatello.getTerrarium().getHeight() / 2);
0 ignored issues
show
Bug introduced by
Math operands should be cast to prevent unwanted loss of precision when mixing types. Consider casting one of the operands of this division to double.
Loading history...
14
    donatello.pw(10);
15
    donatello.pc(new Color(200, 0, 200));
16
    donatello.pu();
17
    donatello.lt(90);
18
    donatello.fd(200);
19
    donatello.rt(90);
20
    donatello.pd();
21
    for (int i = 0; i < 360; i++) {
22
      donatello.fd(Math.PI * 2.0 * 200 / 360.0);
23
      donatello.rt(1);
24
    }
25
    donatello.pu();
26
    donatello.rt(90);
27
    donatello.fd(200);
28
    donatello.lt(90);
29
    donatello.pd();
30
  }
31
}
32