| Conditions | 15 |
| Paths | 15 |
| Total Lines | 58 |
| Code Lines | 30 |
| 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 |
||
| 34 | public static function calcular(IPI $IPI): void |
||
| 35 | { |
||
| 36 | if ($IPI->getCST() === '00') { |
||
| 37 | /* ENTRADA COM RECUPERAÇÃO DE CRÉDITO */ |
||
| 38 | throw new Exception('Not implemented'); |
||
| 39 | // self::calcAliquotaAdValoren($IPI); |
||
| 40 | } elseif ($IPI->getCST() === '01') { |
||
| 41 | /* 01 ENTRADA TRIBUTADA COM ALICOTA ZERO */ |
||
| 42 | throw new Exception('Not implemented'); |
||
| 43 | // self::calcIsento($IPI); |
||
| 44 | } elseif ($IPI->getCST() === '02') { |
||
| 45 | /* ENTRADA ISENTA */ |
||
| 46 | throw new Exception('Not implemented'); |
||
| 47 | // self::calcIsento($IPI); |
||
| 48 | } elseif ($IPI->getCST() === '03') { |
||
| 49 | /* ENTRADA NÃO TRIBUTADA */ |
||
| 50 | throw new Exception('Not implemented'); |
||
| 51 | // self::calcIsento($IPI); |
||
| 52 | } elseif ($IPI->getCST() === '04') { |
||
| 53 | /* ENTRADA IMUNE */ |
||
| 54 | throw new Exception('Not implemented'); |
||
| 55 | // self::calcIsento($IPI); |
||
| 56 | } elseif ($IPI->getCST() === '05') { |
||
| 57 | /* ENTRADA COM SUSPENSAO */ |
||
| 58 | throw new Exception('Not implemented'); |
||
| 59 | // self::calcIsento($IPI); |
||
| 60 | } elseif ($IPI->getCST() === '49') { |
||
| 61 | /* OUTRAS ENTRADAS */ |
||
| 62 | throw new Exception('Not implemented'); |
||
| 63 | // self::calcRetornoIsentoValorOutros($IPI); |
||
| 64 | } elseif ($IPI->getCST() === '50') { |
||
| 65 | /* SAÍDA TRIBUTADA */ |
||
| 66 | self::calcAliquotaAdValoren($IPI); |
||
| 67 | } elseif ($IPI->getCST() === '51') { |
||
| 68 | /* SAÍDA TRIBUTADA COM ALICOTA ZERO */ |
||
| 69 | self::calcIsento($IPI); |
||
| 70 | } elseif ($IPI->getCST() === '52') { |
||
| 71 | /* SAÍDA ISENTA */ |
||
| 72 | throw new Exception('Not implemented'); |
||
| 73 | // self::calcIsento($IPI); |
||
| 74 | } elseif ($IPI->getCST() === '53') { |
||
| 75 | /* SAÍDA NÃO-TRIBUTADA */ |
||
| 76 | throw new Exception('Not implemented'); |
||
| 77 | // self::calcIsento($IPI); |
||
| 78 | } elseif ($IPI->getCST() === '54') { |
||
| 79 | /* SAÍDA IMUNE */ |
||
| 80 | throw new Exception('Not implemented'); |
||
| 81 | // self::calcIsento($IPI); |
||
| 82 | } elseif ($IPI->getCST() === '55') { |
||
| 83 | /* SAÍDA COM SUSPENSAO */ |
||
| 84 | throw new Exception('Not implemented'); |
||
| 85 | // self::calcIsento($IPI); |
||
| 86 | } elseif ($IPI->getCST() === '99') { |
||
| 87 | /* OUTRAS SAÍDAS */ |
||
| 88 | throw new Exception('Not implemented'); |
||
| 89 | // self::calcAliquotaAdValoren($IPI); |
||
| 90 | } else { |
||
| 91 | throw new Exception('Erro ao calcular IPI' . print_r($IPI, true)); |
||
| 92 | } |
||
| 287 |