| 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 |
||
| 28 | public static function calcular(COFINS $COFINS) |
||
| 29 | { |
||
| 30 | /* Operação Tributável com Alíquota Básica */ |
||
| 31 | if ($COFINS->getCST() === '01') { |
||
| 32 | return self::calcaCOFINS($COFINS); |
||
| 33 | } elseif ($COFINS->getCST() === '02') { |
||
| 34 | throw new Exception('Not implemented'); |
||
| 35 | // return self::calcaCOFINS($COFINS); |
||
| 36 | } elseif ($COFINS->getCST() === '03') { |
||
| 37 | throw new Exception('Not implemented'); |
||
| 38 | // return self::calcAliqCST03($COFINS); |
||
| 39 | } elseif ($COFINS->getCST() === '04') { |
||
| 40 | throw new Exception('Not implemented'); |
||
| 41 | // return self::calcIsento($COFINS); |
||
| 42 | } elseif ($COFINS->getCST() === '05') { |
||
| 43 | throw new Exception('Not implemented'); |
||
| 44 | // return self::calcIsento($COFINS); |
||
| 45 | } elseif ($COFINS->getCST() === '06') { |
||
| 46 | throw new Exception('Not implemented'); |
||
| 47 | // return self::calcIsento($COFINS); |
||
| 48 | } elseif ($COFINS->getCST() === '07') { |
||
| 49 | throw new Exception('Not implemented'); |
||
| 50 | // return self::calcIsentoDesconto($COFINS); |
||
| 51 | } elseif ($COFINS->getCST() === '08') { |
||
| 52 | throw new Exception('Not implemented'); |
||
| 53 | // return self::calcIsento($COFINS); |
||
| 54 | } elseif ($COFINS->getCST() === '09') { |
||
| 55 | throw new Exception('Not implemented'); |
||
| 56 | // return self::calcIsento($COFINS); |
||
| 57 | } elseif ($COFINS->getCST() === '49') { |
||
| 58 | throw new Exception('Not implemented'); |
||
| 59 | // return self::calcIsento($COFINS); |
||
| 60 | } elseif ($COFINS->getCST() === '50') { |
||
| 61 | throw new Exception('Not implemented'); |
||
| 62 | // return self::calcaCOFINS($COFINS); |
||
| 63 | } elseif ($COFINS->getCST() === '51') { |
||
| 64 | throw new Exception('Not implemented'); |
||
| 65 | // return self::calcaCOFINS($COFINS); |
||
| 66 | } elseif ($COFINS->getCST() === '52') { |
||
| 67 | throw new Exception('Not implemented'); |
||
| 68 | // return self::calcaCOFINS($COFINS); |
||
| 69 | } elseif ($COFINS->getCST() === '53') { |
||
| 70 | throw new Exception('Not implemented'); |
||
| 71 | // return self::calcaCOFINS($COFINS); |
||
| 72 | } elseif ($COFINS->getCST() === '54') { |
||
| 73 | throw new Exception('Not implemented'); |
||
| 74 | // return self::calcaCOFINS($COFINS); |
||
| 75 | } elseif ($COFINS->getCST() === '55') { |
||
| 76 | throw new Exception('Not implemented'); |
||
| 77 | // return self::calcaCOFINS($COFINS); |
||
| 78 | } elseif ($COFINS->getCST() === '56') { |
||
| 79 | throw new Exception('Not implemented'); |
||
| 80 | // return self::calcaCOFINS($COFINS); |
||
| 81 | } elseif ($COFINS->getCST() === '60') { |
||
| 82 | throw new Exception('Not implemented'); |
||
| 83 | // return self::calcaCOFINS($COFINS); |
||
| 84 | } elseif ($COFINS->getCST() === '61') { |
||
| 85 | throw new Exception('Not implemented'); |
||
| 86 | // return self::calcaCOFINS($COFINS); |
||
| 87 | } elseif ($COFINS->getCST() === '62') { |
||
| 88 | throw new Exception('Not implemented'); |
||
| 89 | // return self::calcaCOFINS($COFINS); |
||
| 90 | } elseif ($COFINS->getCST() === '63') { |
||
| 91 | throw new Exception('Not implemented'); |
||
| 92 | // return self::calcaCOFINS($COFINS); |
||
| 93 | } elseif ($COFINS->getCST() === '64') { |
||
| 94 | throw new Exception('Not implemented'); |
||
| 95 | // return self::calcaCOFINS($COFINS); |
||
| 96 | } elseif ($COFINS->getCST() === '65') { |
||
| 97 | throw new Exception('Not implemented'); |
||
| 98 | // return self::calcaCOFINS($COFINS); |
||
| 99 | } elseif ($COFINS->getCST() === '66') { |
||
| 100 | throw new Exception('Not implemented'); |
||
| 101 | // return self::calcaCOFINS($COFINS); |
||
| 102 | } elseif ($COFINS->getCST() === '67') { |
||
| 103 | throw new Exception('Not implemented'); |
||
| 104 | // return self::calcaCOFINS($COFINS); |
||
| 105 | } elseif ($COFINS->getCST() === '70') { |
||
| 106 | throw new Exception('Not implemented'); |
||
| 107 | // return self::calcIsento($COFINS); |
||
| 108 | } elseif ($COFINS->getCST() === '71') { |
||
| 109 | throw new Exception('Not implemented'); |
||
| 110 | // return self::calcaCOFINS($COFINS); |
||
| 111 | } elseif ($COFINS->getCST() === '72') { |
||
| 112 | throw new Exception('Not implemented'); |
||
| 113 | // return self::calcaCOFINS($COFINS); |
||
| 114 | } elseif ($COFINS->getCST() === '73') { |
||
| 115 | throw new Exception('Not implemented'); |
||
| 116 | // return self::calcaCOFINS($COFINS); |
||
| 117 | } elseif ($COFINS->getCST() === '74') { |
||
| 118 | throw new Exception('Not implemented'); |
||
| 119 | // return self::calcaCOFINS($COFINS); |
||
| 120 | } elseif ($COFINS->getCST() === '75') { |
||
| 121 | throw new Exception('Not implemented'); |
||
| 122 | // return self::calcaCOFINS($COFINS); |
||
| 123 | } elseif ($COFINS->getCST() === '98') { |
||
| 124 | throw new Exception('Not implemented'); |
||
| 125 | // return self::calcaCOFINS($COFINS); |
||
| 126 | } elseif ($COFINS->getCST() === '99') { |
||
| 127 | throw new Exception('Not implemented'); |
||
| 128 | // return self::calcIsento($COFINS); |
||
| 129 | } |
||
| 130 | throw new Exception('Erro ao calcular COFINS' . print_r($COFINS, true)); |
||
| 131 | } |
||
| 204 |