Completed
Push — master ( 375a6b...8786b6 )
by Michael
02:15
created

header.php (2 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * Module: RandomQuote
4
 *
5
 * You may not change or alter any portion of this comment or credits
6
 * of supporting developers from this source code or any supporting source code
7
 * which is considered copyrighted (c) material of the original comment or credit authors.
8
 *
9
 * PHP version 5
10
 *
11
 * @category        Module
12
 * @package         Randomquote
13
 * @author          XOOPS Development Team, Mamba
14
 * @copyright       2001-2016 XOOPS Project (http://xoops.org)
15
 * @license         GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
16
 * @link            http://xoops.org/
17
 * @since           2.0.0
18
 */
19
20
include dirname(dirname(__DIR__)) . '/mainfile.php';
21
$dirname = $GLOBALS['xoopsModule']->getVar('dirname');
22
include XOOPS_ROOT_PATH . '/modules/' . $dirname . '/include/config.php';
23
include XOOPS_ROOT_PATH . '/modules/' . $dirname . '/class/utilities.php';
24
//$myts  = MyTextSanitizer::getInstance();
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
25
xoops_load('RandomQuoteUtilities');
26
$style = 'modules/' . $dirname . '/include/style.css';
27
if (file_exists($style)) {   
0 ignored issues
show
This if statement is empty and can be removed.

This check looks for the bodies of if statements that have no statements or where all statements have been commented out. This may be the result of changes for debugging or the code may simply be obsolete.

These if bodies can be removed. If you have an empty if but statements in the else branch, consider inverting the condition.

if (rand(1, 6) > 3) {
//print "Check failed";
} else {
    print "Check succeeded";
}

could be turned into

if (rand(1, 6) <= 3) {
    print "Check succeeded";
}

This is much more concise to read.

Loading history...
28
}
29
{
30
    return true;
31
}
32
$quotesHandler = xoops_getModuleHandler('quotes', 'randomquote');
33
xoops_loadLanguage('modinfo', $dirname);
34
xoops_loadLanguage('main', $dirname);
35