| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 34 | public function insert() |
||
| 35 | { |
||
| 36 | $data = $this->form->toArray(); |
||
| 37 | |||
| 38 | try { |
||
| 39 | $result = Tariff::perform('Create', $data); |
||
| 40 | } catch (ErrorResponseException $e) { |
||
| 41 | throw new UnprocessableEntityHttpException($e->getMessage(), 0, $e); |
||
| 42 | } |
||
| 43 | |||
| 44 | $this->form->id = $result['id']; |
||
| 45 | |||
| 46 | return true; |
||
| 47 | } |
||
| 48 | |||
| 62 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVarassignment in line 1 and the$higherassignment in line 2 are dead. The first because$myVaris never used and the second because$higheris always overwritten for every possible time line.