Conditions | 2 |
Paths | 2 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
25 | function b_waiting_randomquote() |
||
26 | { |
||
27 | $moduleDirName = basename(dirname(__DIR__)); |
||
28 | require_once $GLOBALS['xoops']->path("/modules/{$moduleDirName}/class/constants.php"); |
||
29 | |||
30 | $xoopsDB = XoopsDatabaseFactory::getDatabaseConnection(); |
||
|
|||
31 | $block = array(); |
||
32 | $quotesHandler = xoops_getModuleHandler('quotes', $moduleDirName); |
||
33 | |||
34 | // quotes waiting approval |
||
35 | $result = $quotesHandler->getCount(new Criteria('quote_status', RandomquoteConstants::STATUS_WAITING)); |
||
36 | if ($result) { |
||
37 | $block = array('adminlink' => $GLOBALS['xoops']->url("www/modules/{$moduleDirName}/admin/main.php?op=list&status=" . RandomquoteConstants::STATUS_WAITING), |
||
38 | 'pendingnum' => (int)$result, |
||
39 | 'lang_linkname' => _PI_WAITING_WAITINGS); |
||
40 | } |
||
41 | |||
42 | return $block; |
||
43 | } |
||
44 |
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.