1 package com.puppycrawl.tools.checkstyle.checks.metrics.npathcomplexity;
2
3 public class InputNPathComplexityDefault {
4
5 public void foo() {
6
7 while (true) {
8 Runnable runnable = new Runnable() {
9
10 public void run() {
11
12 while (true) {
13 }
14 }
15 };
16
17 new Thread(runnable).start();
18 }
19 }
20
21
22 public void bar() {
23
24 if (System.currentTimeMillis() == 0) {
25
26 if (System.currentTimeMillis() == 0 && System.currentTimeMillis() == 0) {
27 }
28
29 if (System.currentTimeMillis() == 0 || System.currentTimeMillis() == 0) {
30 }
31 }
32 }
33
34
35 public void simpleElseIf() {
36
37 if (System.currentTimeMillis() == 0) {
38
39 } else if (System.currentTimeMillis() == 0) {
40 } else {
41 }
42 }
43
44
45 public void stupidElseIf() {
46
47 if (System.currentTimeMillis() == 0) {
48 } else {
49
50 if (System.currentTimeMillis() == 0) {
51 } else {
52
53 if (System.currentTimeMillis() == 0) {
54 }
55 }
56
57 if (System.currentTimeMillis() == 0) {
58 }
59 }
60 }
61
62
63 public InputNPathComplexityDefault()
64 {
65 int i = 1;
66
67 if (System.currentTimeMillis() == 0) {
68
69 } else if (System.currentTimeMillis() == 0) {
70 } else {
71 }
72 }
73
74
75
76 static {
77 int i = 1;
78
79 if (System.currentTimeMillis() == 0) {
80
81 } else if (System.currentTimeMillis() == 0) {
82 } else {
83 }
84 }
85
86
87
88 {
89 int i = 1;
90
91 if (System.currentTimeMillis() == 0) {
92
93 } else if (System.currentTimeMillis() == 0) {
94 } else {
95 }
96 }
97
98
99
100 public InputNPathComplexityDefault(int aParam)
101 {
102 Runnable runnable = new Runnable() {
103
104 public void run() {
105
106 while (true) {
107 }
108 }
109 };
110 new Thread(runnable).start();
111 }
112
113 public void InputNestedTernaryCheck() {
114 double x = (getSmth() || Math.random() == 5) ? null : (int) Math
115 .cos(400 * (10 + 40));
116 double y = (0.2 == Math.random()) ? (0.3 == Math.random()) ? null : (int) Math
117 .cos(400 * (10 + 40)) : 6;
118 double z = (Integer) ((0.2 == Math.random()) ? (Integer) null + apply(null)
119 : (0.3 == Math.random()) ? (Integer) null : (int) Math
120 .sin(300 * (12 + 30)));
121
122 }
123 public boolean getSmth() { return true; };
124 public int apply(Object o) { return 0; }
125
126 public void inClass(int type, Short s, int color) {
127 switch (type) {
128 case 3:
129 new Object() {
130 public void anonymousMethod() {
131 {
132 switch (s) {
133 case 5:
134 switch (type) {
135 default:
136 }
137 }
138 }
139 }
140 };
141 default:
142 new Object() {
143 class SwitchClass {
144 {
145 switch (color) {
146 case 5:
147 switch (type) {
148 default:
149 }
150 }
151 }
152 }
153 };
154 }
155 }
156 }