Conditions | 3 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 5 |
Lines | 9 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
49 | View Code Duplication | public function decode($text) |
|
50 | { |
||
51 | $pad = ord(substr($text, -1)); |
||
52 | if ($pad < 1 || $pad > 32) { |
||
53 | $pad = 0; |
||
54 | } |
||
55 | |||
56 | return substr($text, 0, (strlen($text) - $pad)); |
||
57 | } |
||
58 | } |
||
59 |
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.