Conditions | 34 |
Paths | 34 |
Total Lines | 103 |
Code Lines | 67 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
27 | public static function calcular(PIS $PIS) |
||
28 | { |
||
29 | /* Operação Tributável com Alíquota Básica */ |
||
30 | if ($PIS->getCST() === '01') { |
||
31 | return self::calcaPIS($PIS); |
||
32 | } elseif ($PIS->getCST() === '02') { |
||
33 | throw new Exception('Not implemented'); |
||
34 | // return self::calcaPIS($PIS); |
||
35 | } elseif ($PIS->getCST() === '03') { |
||
36 | throw new Exception('Not implemented'); |
||
37 | // return self::calcAliqCST03($PIS); |
||
38 | } elseif ($PIS->getCST() === '04') { |
||
39 | throw new Exception('Not implemented'); |
||
40 | // return self::calcIsento($PIS); |
||
41 | } elseif ($PIS->getCST() === '05') { |
||
42 | throw new Exception('Not implemented'); |
||
43 | // return self::calcIsento($PIS); |
||
44 | } elseif ($PIS->getCST() === '06') { |
||
45 | throw new Exception('Not implemented'); |
||
46 | // return self::calcIsento($PIS); |
||
47 | } elseif ($PIS->getCST() === '07') { |
||
48 | throw new Exception('Not implemented'); |
||
49 | // return self::calcIsentoDesconto($PIS); |
||
50 | } elseif ($PIS->getCST() === '08') { |
||
51 | throw new Exception('Not implemented'); |
||
52 | // return self::calcIsento($PIS); |
||
53 | } elseif ($PIS->getCST() === '09') { |
||
54 | throw new Exception('Not implemented'); |
||
55 | // return self::calcIsento($PIS); |
||
56 | } elseif ($PIS->getCST() === '49') { |
||
57 | throw new Exception('Not implemented'); |
||
58 | // return self::calcIsento($PIS); |
||
59 | } elseif ($PIS->getCST() === '50') { |
||
60 | throw new Exception('Not implemented'); |
||
61 | // return self::calcaPIS($PIS); |
||
62 | } elseif ($PIS->getCST() === '51') { |
||
63 | throw new Exception('Not implemented'); |
||
64 | // return self::calcaPIS($PIS); |
||
65 | } elseif ($PIS->getCST() === '52') { |
||
66 | throw new Exception('Not implemented'); |
||
67 | // return self::calcaPIS($PIS); |
||
68 | } elseif ($PIS->getCST() === '53') { |
||
69 | throw new Exception('Not implemented'); |
||
70 | // return self::calcaPIS($PIS); |
||
71 | } elseif ($PIS->getCST() === '54') { |
||
72 | throw new Exception('Not implemented'); |
||
73 | // return self::calcaPIS($PIS); |
||
74 | } elseif ($PIS->getCST() === '55') { |
||
75 | throw new Exception('Not implemented'); |
||
76 | // return self::calcaPIS($PIS); |
||
77 | } elseif ($PIS->getCST() === '56') { |
||
78 | throw new Exception('Not implemented'); |
||
79 | // return self::calcaPIS($PIS); |
||
80 | } elseif ($PIS->getCST() === '60') { |
||
81 | throw new Exception('Not implemented'); |
||
82 | // return self::calcaPIS($PIS); |
||
83 | } elseif ($PIS->getCST() === '61') { |
||
84 | throw new Exception('Not implemented'); |
||
85 | // return self::calcaPIS($PIS); |
||
86 | } elseif ($PIS->getCST() === '62') { |
||
87 | throw new Exception('Not implemented'); |
||
88 | // return self::calcaPIS($PIS); |
||
89 | } elseif ($PIS->getCST() === '63') { |
||
90 | throw new Exception('Not implemented'); |
||
91 | // return self::calcaPIS($PIS); |
||
92 | } elseif ($PIS->getCST() === '64') { |
||
93 | throw new Exception('Not implemented'); |
||
94 | // return self::calcaPIS($PIS); |
||
95 | } elseif ($PIS->getCST() === '65') { |
||
96 | throw new Exception('Not implemented'); |
||
97 | // return self::calcaPIS($PIS); |
||
98 | } elseif ($PIS->getCST() === '66') { |
||
99 | throw new Exception('Not implemented'); |
||
100 | // return self::calcaPIS($PIS); |
||
101 | } elseif ($PIS->getCST() === '67') { |
||
102 | throw new Exception('Not implemented'); |
||
103 | // return self::calcaPIS($PIS); |
||
104 | } elseif ($PIS->getCST() === '70') { |
||
105 | throw new Exception('Not implemented'); |
||
106 | // return self::calcIsento($PIS); |
||
107 | } elseif ($PIS->getCST() === '71') { |
||
108 | throw new Exception('Not implemented'); |
||
109 | // return self::calcaPIS($PIS); |
||
110 | } elseif ($PIS->getCST() === '72') { |
||
111 | throw new Exception('Not implemented'); |
||
112 | // return self::calcaPIS($PIS); |
||
113 | } elseif ($PIS->getCST() === '73') { |
||
114 | throw new Exception('Not implemented'); |
||
115 | // return self::calcaPIS($PIS); |
||
116 | } elseif ($PIS->getCST() === '74') { |
||
117 | throw new Exception('Not implemented'); |
||
118 | // return self::calcaPIS($PIS); |
||
119 | } elseif ($PIS->getCST() === '75') { |
||
120 | throw new Exception('Not implemented'); |
||
121 | // return self::calcaPIS($PIS); |
||
122 | } elseif ($PIS->getCST() === '98') { |
||
123 | throw new Exception('Not implemented'); |
||
124 | // return self::calcaPIS($PIS); |
||
125 | } elseif ($PIS->getCST() === '99') { |
||
126 | throw new Exception('Not implemented'); |
||
127 | // return self::calcIsento($PIS); |
||
128 | } |
||
129 | throw new Exception('Erro ao calcular PIS' . print_r($PIS, true)); |
||
130 | } |
||
200 |