These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /* |
||
3 | * You may not change or alter any portion of this comment or credits |
||
4 | * of supporting developers from this source code or any supporting source code |
||
5 | * which is considered copyrighted (c) material of the original comment or credit authors. |
||
6 | * |
||
7 | * This program is distributed in the hope that it will be useful, |
||
8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
||
10 | */ |
||
11 | |||
12 | /** |
||
13 | * @copyright XOOPS Project http://xoops.org/ |
||
14 | * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) |
||
15 | * @package |
||
16 | * @since |
||
17 | * @author XOOPS Development Team |
||
18 | */ |
||
19 | |||
20 | include XOOPS_ROOT_PATH . '/header.php'; |
||
21 | |||
22 | if (!isset($moduleDirName)) { |
||
23 | $moduleDirName = basename(dirname(__DIR__)); |
||
24 | } |
||
25 | |||
26 | if (false !== ($moduleHelper = Xmf\Module\Helper::getHelper($moduleDirName))) { |
||
0 ignored issues
–
show
|
|||
27 | } else { |
||
28 | $moduleHelper = Xmf\Module\Helper::getHelper('system'); |
||
29 | } |
||
30 | |||
31 | View Code Duplication | 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. ![]() This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
32 | require_once $GLOBALS['xoops']->path('class/template.php'); |
||
33 | $xoopsTpl = new XoopsTpl(); |
||
34 | } |
||
35 | |||
36 | $GLOBALS['xoopsTpl']->assign('api_key', $moduleHelper->getConfig('apcal_mapsapi')); |
||
37 | echo $moduleHelper->getConfig('apcal_mapsapi'); |
||
38 | $skin_folder = $moduleHelper->getConfig('skin_folder'); |
||
39 | |||
40 | |||
41 | |||
42 | |||
43 | |||
44 | |||
45 | |||
46 |
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 theelse
branch, consider inverting the condition.could be turned into
This is much more concise to read.