Conditions | 3 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
28 | 1 | public function draw(array $data) |
|
29 | { |
||
30 | 1 | $ret = ''; |
|
|
|||
31 | |||
32 | 1 | if ($data['front']) { |
|
33 | 1 | $title = $this->fillParam($data, 'title', ''); |
|
34 | |||
35 | 1 | if ($title !== '') { |
|
36 | 1 | $ret = '<abbr title="' . $this->e($title) . '">'; |
|
37 | 1 | } else { |
|
38 | 1 | $ret = '<abbr>'; |
|
39 | } |
||
40 | 1 | } else { |
|
41 | 1 | $ret = '</abbr>'; |
|
42 | } |
||
43 | |||
44 | 1 | return $ret; |
|
45 | } |
||
46 | } |
||
47 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.