| Conditions | 3 |
| Paths | 3 |
| Total Lines | 22 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | 4 | public function draw(array $data) |
|
| 29 | { |
||
| 30 | 4 | $ret = ''; |
|
|
|
|||
| 31 | |||
| 32 | 4 | if ($data['front']) { |
|
| 33 | 4 | $href = $this->fillParam($data, 'href', ''); |
|
| 34 | |||
| 35 | 4 | $title = $this->fillParam($data, 'title', null); |
|
| 36 | |||
| 37 | 4 | if ($title !== null) { |
|
| 38 | 1 | $title = ' title="' . $this->e($title) . '"'; |
|
| 39 | 1 | } else { |
|
| 40 | 4 | $title = ' title="Open "' . $this->e($href) . '""'; |
|
| 41 | } |
||
| 42 | |||
| 43 | 4 | $ret = '<a href="' . $this->e($href) . '"' . $title . '>'; |
|
| 44 | 4 | } else { |
|
| 45 | 4 | $ret = '</a>'; |
|
| 46 | } |
||
| 47 | |||
| 48 | 4 | return $ret; |
|
| 49 | } |
||
| 50 | } |
||
| 51 |
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.