Conditions | 3 |
Paths | 4 |
Total Lines | 24 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 4 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
5 | function b_waiting_yomi() |
||
6 | { |
||
7 | $log_path = XOOPS_ROOT_PATH . '/modules/yomi/log/'; |
||
8 | $log_file = 'ys4_temp.cgi'; |
||
9 | $lang_linkname = 'Yomi'; |
||
|
|||
10 | $block = array(); |
||
11 | $cTemp = 0; |
||
12 | $fp = fopen("{$log_path}{$log_file}", 'r'); |
||
13 | |||
14 | while ($tmp = fgets($fp, 4096)) { |
||
15 | ++$cTemp; |
||
16 | } |
||
17 | fclose($fp); |
||
18 | |||
19 | if (0 !== $cTemp) { |
||
20 | $block = array( |
||
21 | 'adminlink' => XOOPS_URL . '/modules/yomi/admin.php', |
||
22 | 'pendingnum' => $cTemp, |
||
23 | 'lang_linkname' => _PI_WAITING_WAITINGS |
||
24 | ); |
||
25 | } |
||
26 | |||
27 | return $block; |
||
28 | } |
||
29 |
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.