htdocs/admin.php
Method showRSS
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function showRSS() {
global $icmsAdminTpl, $icmsConfigPersona;
$rssurl = $icmsConfigPersona['rss_local'];
$rssfile = ICMS_CACHE_PATH . '/adminnews_' . _LANGCODE . '.xml';
Missing class import via use statement (line '87', column '14'). Open
Open
$feed = new icms_feeds_Simplerss();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Avoid unused local variables such as '$rssfile'. Open
Open
$rssfile = ICMS_CACHE_PATH . '/adminnews_' . _LANGCODE . '.xml';
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Suspicious type null
of a variable or expression used to build a string. (Expected type to be able to cast to a string) Open
Open
if (!file_exists(ICMS_CACHE_PATH . '/adminmenu_' . $icmsConfig['language'] . '.php')) {
- Exclude checks
Call to method set_cache_duration
from undeclared class \icms_feeds_Simplerss
Open
Open
$feed->set_cache_duration(3600);
- Exclude checks
Call to method set_autodiscovery_level
from undeclared class \icms_feeds_Simplerss
Open
Open
$feed->set_autodiscovery_level(SIMPLEPIE_LOCATOR_NONE);
- Exclude checks
Reference to instance property error
from undeclared class \icms_feeds_Simplerss
Open
Open
if (!$feed->error) {
- Exclude checks
Invalid offset "language"
of array type array{startpage:,template_set:mixed}
Open
Open
if (!file_exists(ICMS_CACHE_PATH . '/adminmenu_' . $icmsConfig['language'] . '.php')) {
- Exclude checks
Call to method get_title
from undeclared class \icms_feeds_Simplerss
Open
Open
$icmsAdminTpl->assign('admin_rss_feed_title', $feed->get_title());
- Exclude checks
Call to method get_description
from undeclared class \icms_feeds_Simplerss
Open
Open
$icmsAdminTpl->assign('admin_rss_feed_dsc', $feed->get_description());
- Exclude checks
Call to method init
from undeclared class \icms_feeds_Simplerss
Open
Open
$feed->init();
- Exclude checks
Call to method set_feed_url
from undeclared class \icms_feeds_Simplerss
Open
Open
$feed->set_feed_url($rssurl);
- 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
Open
xoops_module_write_admin_menu(impresscms_get_adminmenu());
- Exclude checks
Reference to undeclared constant \_LANGCODE
Open
Open
$rssfile = ICMS_CACHE_PATH . '/adminnews_' . _LANGCODE . '.xml';
- Exclude checks
Call to method __construct
from undeclared class \icms_feeds_Simplerss
Open
Open
$feed = new icms_feeds_Simplerss();
- Exclude checks
Call to method get_link
from undeclared class \icms_feeds_Simplerss
Open
Open
$icmsAdminTpl->assign('admin_rss_feed_link', $feed->get_link());
- Exclude checks
Call to method handle_content_type
from undeclared class \icms_feeds_Simplerss
Open
Open
$feed->handle_content_type();
- Exclude checks
Call to method get_items
from undeclared class \icms_feeds_Simplerss
Open
Open
foreach ($feed->get_items() as $item) {
- Exclude checks
Reference to undeclared constant \SIMPLEPIE_LOCATOR_NONE
Open
Open
$feed->set_autodiscovery_level(SIMPLEPIE_LOCATOR_NONE);
- Exclude checks
Closing brace must be on a line by itself Open
Open
if (!empty($_POST['op'])) {$op = (int) ($_POST['op']);}
- Exclude checks
Newline required after opening brace Open
Open
if (!empty($_POST['op'])) {$op = (int) ($_POST['op']);}
- Exclude checks
Closing brace must be on a line by itself Open
Open
if (!empty($_GET['op'])) {$op = (int) ($_GET['op']);}
- Exclude checks
Newline required after opening brace Open
Open
if (!empty($_GET['op'])) {$op = (int) ($_GET['op']);}
- Exclude checks