File main.php
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
// $Id: main.php 12313 2013-09-15 21:14:35Z skenow $
// ------------------------------------------------------------------------ //
// XOOPS - PHP Content Management System //
// Copyright (c) 2000 XOOPS.org //
Call to method checkVarArray
from undeclared class \icms_core_DataFilter
Open
$clean_GET = icms_core_DataFilter::checkVarArray($_GET, $filter_get, false);
- Exclude checks
Variable $oldname
is undeclared Open
if ($newname[$mid] != $oldname[$mid]) {
- Exclude checks
Variable $from_112
is undeclared Open
if ($from_112) {
- Exclude checks
Variable $oldstatus
is undeclared Open
if ($oldstatus[$mid] == 0) {
- Exclude checks
Variable $oldweight
is undeclared Open
if ($oldweight[$mid] != $weight[$mid]) {
- Exclude checks
Variable $weight
is undeclared Open
echo $weight[$mid];
- Exclude checks
Variable $oldstatus
is undeclared Open
if ($oldstatus[$mid] == 0) {
- Exclude checks
Variable $newname
is undeclared Open
$newname[$mid] = trim($newname[$mid]);
- Exclude checks
Reference to static property user
from undeclared class \icms
Open
if (!is_object(icms::$user) || !is_object(icms::$module) || !icms::$user->isAdmin(icms::$module->getVar('mid'))) {
- Exclude checks
Variable $oldstatus
is undeclared Open
if ($oldstatus[$mid] == 1) {
- Exclude checks
Variable $weight
is undeclared Open
if ($oldweight[$mid] != $weight[$mid]) {
- Exclude checks
Variable $oldstatus
is undeclared Open
."' /><input type='hidden' name='oldstatus[" . $mid . "]' value='" . (int) $oldstatus[$mid]
- Exclude checks
Variable $oldweight
is undeclared Open
."' /><input type='hidden' name='oldweight[" . $mid . "]' value='" . (int) $oldweight[$mid]
- Exclude checks
Variable $weight
is undeclared Open
if ($oldname[$mid] != $newname[$mid] || $oldweight[$mid] != $weight[$mid]) {
- Exclude checks
Reference to static property module
from undeclared class \icms
Open
if (!is_object(icms::$user) || !is_object(icms::$module) || !icms::$user->isAdmin(icms::$module->getVar('mid'))) {
- Exclude checks
Reference to undeclared constant \_YES
Open
icms_core_Message::confirm(array('module' => $module, 'op' => 'uninstall_ok', 'fct' => 'modulesadmin'), 'admin.php', $msgs, _YES);
- Exclude checks
Reference to static property security
from undeclared class \icms
Open
if (!icms::$security->check()) {
- Exclude checks
Variable $weight
is undeclared Open
."' /><input type='hidden' name='weight[" . $mid . "]' value='" . (int) $weight[$mid]
- Exclude checks
Variable $module
is undeclared Open
foreach ($module as $mid) {
- Exclude checks
Call to method stripSlashesGPC
from undeclared class \icms_core_DataFilter
Open
echo '<tr class="' . $class . '"><td align="center">' . icms_core_DataFilter::stripSlashesGPC($oldname[$mid]);
- Exclude checks
Call to method confirm
from undeclared class \icms_core_Message
Open
icms_core_Message::confirm(array('module' => $module, 'op' => 'uninstall_ok', 'fct' => 'modulesadmin'), 'admin.php', $msgs, _YES);
- Exclude checks
Call to method confirm
from undeclared class \icms_core_Message
Open
icms_core_Message::confirm(array('module' => $module, 'op' => 'install_ok', 'fct' => 'modulesadmin', 'from_112' => $from_112), 'admin.php', $msgs, _MD_AM_INSTALL);
- Exclude checks
Variable $module
is undeclared Open
foreach ($module as $mid) {
- Exclude checks
Variable $oldname
is undeclared Open
."' /><input type='hidden' name='oldname[" . $mid . "]' value='" . htmlspecialchars($oldname[$mid], ENT_QUOTES)
- Exclude checks
Variable $oldname
is undeclared Open
if ($oldname[$mid] != $newname[$mid] || $oldweight[$mid] != $weight[$mid]) {
- Exclude checks
Call to method __construct
from undeclared class \icms_view_Tpl
Open
$icmsAdminTpl = new icms_view_Tpl();
- Exclude checks
Call to method error
from undeclared class \icms_core_Message
Open
icms_core_Message::error($error);
- Exclude checks
Variable $newname
was undeclared, but array fields are being added to it. Open
$newname[$mid] = trim($newname[$mid]);
- Exclude checks
Call to method handler
from undeclared class \icms
Open
$module_handler = icms::handler('icms_module');
- Exclude checks
Variable $newname
was undeclared, but array fields are being added to it. Open
$newname[$mid] = trim(icms_core_DataFilter::stripslashesGPC($newname[$mid]));
- Exclude checks
Call to method checkVarArray
from undeclared class \icms_core_DataFilter
Open
$clean_POST = icms_core_DataFilter::checkVarArray($_POST, $filter_post, false);
- Exclude checks
Call to method stripslashesGPC
from undeclared class \icms_core_DataFilter
Open
$newname[$mid] = trim(icms_core_DataFilter::stripslashesGPC($newname[$mid]));
- Exclude checks
Variable $weight
is undeclared Open
echo "<span style='color:#ff0000;font-weight:bold;'>" . $weight[$mid] . "</span>";
- Exclude checks
Variable $oldstatus
is undeclared Open
if ($oldstatus[$mid] == 1) {
- Exclude checks
Variable $oldweight
is undeclared Open
if ($oldname[$mid] != $newname[$mid] || $oldweight[$mid] != $weight[$mid]) {
- Exclude checks
Variable $weight
is undeclared Open
$ret[] = xoops_module_change($mid, $weight[$mid], $newname[$mid]);
- Exclude checks
Suspicious argument null
for an echo/print statement Open
echo xoops_module_list();
- Exclude checks
Reference to undeclared constant \_MUSTWABLE
Open
$error[] = sprintf(_MUSTWABLE, "<strong>" . ICMS_CACHE_PATH . '/</strong>');
- Exclude checks
Reference to static property security
from undeclared class \icms
Open
. "' onclick='location=\"admin.php?fct=modulesadmin\"' />" . icms::$security->getTokenHTML()
- Exclude checks
Variable $module
is undeclared Open
$ret[] = xoops_module_uninstall($module);
- Exclude checks
Call to method handler
from undeclared class \icms
Open
$module_handler = icms::handler('icms_module');
- Exclude checks
Argument 1 (content)
is array
but \xoops_module_write_admin_menu()
takes string
defined at /code/htdocs/include/cp_functions.php:583
Open
if (!xoops_module_write_admin_menu($contents)) {
- Exclude checks
Argument 1 (content)
is array
but \xoops_module_write_admin_menu()
takes string
defined at /code/htdocs/include/cp_functions.php:583
Open
if (!xoops_module_write_admin_menu($contents)) {
- Exclude checks
Call to method error
from undeclared class \icms_core_Message
Open
icms_core_Message::error(sprintf(_MD_AM_IMAGESFOLDER_UPDATE_TEXT, str_ireplace(ICMS_ROOT_PATH, "", ICMS_IMANAGER_FOLDER_PATH)), _MD_AM_IMAGESFOLDER_UPDATE_TITLE, TRUE);
- Exclude checks
Call to method confirm
from undeclared class \icms_core_Message
Open
icms_core_Message::confirm(array('module' => $module, 'op' => 'update_ok', 'fct' => 'modulesadmin'), 'admin.php', $msgs, _MD_AM_UPDATE);
- Exclude checks
Variable $module
is undeclared Open
$ret[] = xoops_module_install($module);
- Exclude checks
Call to method error
from undeclared class \icms_core_Message
Open
icms_core_Message::error(sprintf(_MD_AM_PLUGINSFOLDER_UPDATE_TEXT, ICMS_PLUGINS_PATH,ICMS_ROOT_PATH . '/plugins/preloads'), _MD_AM_PLUGINSFOLDER_UPDATE_TITLE, TRUE);
- Exclude checks
Argument 1 (content)
is array
but \xoops_module_write_admin_menu()
takes string
defined at /code/htdocs/include/cp_functions.php:583
Open
if (!xoops_module_write_admin_menu($contents)) {
- Exclude checks
Call to method handler
from undeclared class \icms
Open
$module_handler = icms::handler('icms_module');
- Exclude checks
Variable $module
is undeclared Open
$ret[] = icms_module_update($module);
- Exclude checks
Variable $module
is undeclared Open
$ret[] = icms_module_update($module);
- Exclude checks
Argument 1 (content)
is array
but \xoops_module_write_admin_menu()
takes string
defined at /code/htdocs/include/cp_functions.php:583
Open
if (!xoops_module_write_admin_menu($contents)) {
- Exclude checks
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ($op == 'update_ok') {
$ret = array();
$ret[] = icms_module_update($module);
$contents = impresscms_get_adminmenu();
if (!xoops_module_write_admin_menu($contents)) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 143.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ($op == 'uninstall_ok') {
$ret = array();
$ret[] = xoops_module_uninstall($module);
$contents = impresscms_get_adminmenu();
if (!xoops_module_write_admin_menu($contents)) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 143.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 3 locations. Consider refactoring. Open
if ($mod->getInfo('image') != FALSE && trim($mod->getInfo('image')) != '') {
$msgs ='<img src="' . ICMS_MODULES_URL . '/' . $mod->getVar('dirname') . '/' . trim($mod->getInfo('image')) . '" alt="" />';
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 92.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 3 locations. Consider refactoring. Open
if ($mod->getInfo('image') != FALSE && trim($mod->getInfo('image')) != '') {
$msgs ='<img src="' . ICMS_MODULES_URL . '/' . $mod->getVar('dirname') . '/' . trim($mod->getInfo('image')) . '" alt="" />';
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 92.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 3 locations. Consider refactoring. Open
if ($mod->getInfo('image') != FALSE && trim($mod->getInfo('image')) != '') {
$msgs ='<img src="' . ICMS_MODULES_URL . '/' . $mod->getVar('dirname') . '/' . trim($mod->getInfo('image')) . '" alt="" />';
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 92.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
TRUE, FALSE and NULL must be lowercase; expected "true" but found "TRUE" Open
$write = TRUE;
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "false" but found "FALSE" Open
if ($mod->getInfo('image') != FALSE && trim($mod->getInfo('image')) != '') {
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "false" but found "FALSE" Open
if ($mod->getInfo('image') != FALSE && trim($mod->getInfo('image')) != '') {
- Exclude checks
Blank line found at end of control structure Open
- Exclude checks
Blank line found at start of control structure Open
if (icms_getModuleInfo('system')->getDBVersion() < 14 && (!is_writable(ICMS_PLUGINS_PATH) || !is_dir(ICMS_ROOT_PATH . '/plugins/preloads') || !is_writable(ICMS_ROOT_PATH . '/plugins/preloads'))) {
- Exclude checks
Blank line found at end of control structure Open
- Exclude checks
Blank line found at end of control structure Open
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "false" but found "FALSE" Open
$from_112 = FALSE;
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "false" but found "FALSE" Open
if ($mod->getInfo('image') != FALSE && trim($mod->getInfo('image')) != '') {
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "true" but found "TRUE" Open
icms_core_Message::error(sprintf(_MD_AM_IMAGESFOLDER_UPDATE_TEXT, str_ireplace(ICMS_ROOT_PATH, "", ICMS_IMANAGER_FOLDER_PATH)), _MD_AM_IMAGESFOLDER_UPDATE_TITLE, TRUE);
- Exclude checks
Blank line found at start of control structure Open
if (isset($newstatus[$mid]) && $newstatus[$mid] ==1) {
- Exclude checks
Blank line found at start of control structure Open
if (isset($newstatus[$mid]) && $newstatus[$mid] ==1) {
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "true" but found "TRUE" Open
icms_core_Message::error(sprintf(_MD_AM_PLUGINSFOLDER_UPDATE_TEXT, ICMS_PLUGINS_PATH,ICMS_ROOT_PATH . '/plugins/preloads'), _MD_AM_PLUGINSFOLDER_UPDATE_TITLE, TRUE);
- Exclude checks
Blank line found at end of control structure Open
- Exclude checks
Blank line found at start of control structure Open
foreach ($module as $mid) {
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "true" but found "TRUE" Open
icms_loadLanguageFile('system', 'blocksadmin', TRUE);
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "false" but found "FALSE" Open
$write = FALSE;
- Exclude checks
Inline control structures are not allowed Open
if (isset($_GET['filter_post'])) unset($_GET['filter_post']);
- Exclude checks
No space found after comma in function call Open
icms_core_Message::error(sprintf(_MD_AM_PLUGINSFOLDER_UPDATE_TEXT, ICMS_PLUGINS_PATH,ICMS_ROOT_PATH . '/plugins/preloads'), _MD_AM_PLUGINSFOLDER_UPDATE_TITLE, TRUE);
- Exclude checks
Expected 1 newline at end of file; 0 found Open
}
- Exclude checks