These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /** |
||
3 | * xLanguage module (eXtensible Language Management For XOOPS) |
||
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 | * This program is distributed in the hope that it will be useful, |
||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
||
11 | * |
||
12 | * @copyright XOOPS Project (https://xoops.org) |
||
13 | * @license {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License} |
||
14 | * @package xlanguage |
||
15 | * @since 2.0 |
||
16 | * @author XOOPS Development Team |
||
17 | **/ |
||
18 | |||
19 | require_once __DIR__ . '/../../../include/cp_header.php'; |
||
20 | //require_once $GLOBALS['xoops']->path('www/class/xoopsformloader.php'); |
||
0 ignored issues
–
show
|
|||
21 | |||
22 | require_once __DIR__ . '/../class/utility.php'; |
||
23 | //require_once __DIR__ . '/../include/common.php'; |
||
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...
|
|||
24 | |||
25 | $moduleDirName = basename(dirname(__DIR__)); |
||
26 | |||
27 | if (false !== ($moduleHelper = Xmf\Module\Helper::getHelper($moduleDirName))) { |
||
28 | } else { |
||
29 | $moduleHelper = Xmf\Module\Helper::getHelper('system'); |
||
30 | } |
||
31 | $adminObject = \Xmf\Module\Admin::getInstance(); |
||
32 | |||
33 | $pathIcon16 = \Xmf\Module\Admin::iconUrl('', 16); |
||
34 | $pathIcon32 = \Xmf\Module\Admin::iconUrl('', 32); |
||
35 | $pathModIcon32 = $moduleHelper->getModule()->getInfo('modicons32'); |
||
36 | |||
37 | // Load language files |
||
38 | $moduleHelper->loadLanguage('admin'); |
||
39 | $moduleHelper->loadLanguage('modinfo'); |
||
40 | $moduleHelper->loadLanguage('main'); |
||
41 | |||
42 | $myts = MyTextSanitizer::getInstance(); |
||
43 | |||
44 | if (!isset($GLOBALS['xoopsTpl']) || !($GLOBALS['xoopsTpl'] instanceof XoopsTpl)) { |
||
0 ignored issues
–
show
The class
XoopsTpl does not exist. Did you forget a USE statement, or did you not list all dependencies?
This error could be the result of: 1. Missing dependenciesPHP Analyzer uses your Are you sure this class is defined by one of your dependencies, or did you maybe
not list a dependency in either the 2. Missing use statementPHP does not complain about undefined classes in if ($x instanceof DoesNotExist) {
// Do something.
}
If you have not tested against this specific condition, such errors might go unnoticed.
Loading history...
|
|||
45 | require_once $GLOBALS['xoops']->path('class/template.php'); |
||
46 | $xoopsTpl = new XoopsTpl(); |
||
47 | } |
||
48 |
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.