ImpressCMS/impresscms

View on GitHub
htdocs/admin.php

Summary

Maintainability
A
1 hr
Test Coverage

Method showRSS has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function showRSS() {
    global $icmsAdminTpl, $icmsConfigPersona;

    $rssurl = $icmsConfigPersona['rss_local'];
    $rssfile = ICMS_CACHE_PATH . '/adminnews_' . _LANGCODE . '.xml';
Severity: Minor
Found in htdocs/admin.php - About 1 hr to fix

    Missing class import via use statement (line '87', column '14').
    Open

        $feed = new icms_feeds_Simplerss();
    Severity: Minor
    Found in htdocs/admin.php by phpmd

    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

        $rssfile = ICMS_CACHE_PATH . '/adminnews_' . _LANGCODE . '.xml';
    Severity: Minor
    Found in htdocs/admin.php by phpmd

    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

    if (!file_exists(ICMS_CACHE_PATH . '/adminmenu_' . $icmsConfig['language'] . '.php')) {
    Severity: Minor
    Found in htdocs/admin.php by phan

    Call to method set_cache_duration from undeclared class \icms_feeds_Simplerss
    Open

        $feed->set_cache_duration(3600);
    Severity: Critical
    Found in htdocs/admin.php by phan

    Call to method set_autodiscovery_level from undeclared class \icms_feeds_Simplerss
    Open

        $feed->set_autodiscovery_level(SIMPLEPIE_LOCATOR_NONE);
    Severity: Critical
    Found in htdocs/admin.php by phan

    Reference to instance property error from undeclared class \icms_feeds_Simplerss
    Open

        if (!$feed->error) {
    Severity: Minor
    Found in htdocs/admin.php by phan

    Invalid offset "language" of array type array{startpage:,template_set:mixed}
    Open

    if (!file_exists(ICMS_CACHE_PATH . '/adminmenu_' . $icmsConfig['language'] . '.php')) {
    Severity: Minor
    Found in htdocs/admin.php by phan

    Call to method get_title from undeclared class \icms_feeds_Simplerss
    Open

            $icmsAdminTpl->assign('admin_rss_feed_title', $feed->get_title());
    Severity: Critical
    Found in htdocs/admin.php by phan

    Call to method get_description from undeclared class \icms_feeds_Simplerss
    Open

            $icmsAdminTpl->assign('admin_rss_feed_dsc', $feed->get_description());
    Severity: Critical
    Found in htdocs/admin.php by phan

    Call to method init from undeclared class \icms_feeds_Simplerss
    Open

        $feed->init();
    Severity: Critical
    Found in htdocs/admin.php by phan

    Call to method set_feed_url from undeclared class \icms_feeds_Simplerss
    Open

        $feed->set_feed_url($rssurl);
    Severity: Critical
    Found in htdocs/admin.php by phan

    Argument 1 (content) is array but \xoops_module_write_admin_menu() takes string defined at /code/htdocs/include/cp_functions.php:583
    Open

        xoops_module_write_admin_menu(impresscms_get_adminmenu());
    Severity: Minor
    Found in htdocs/admin.php by phan

    Reference to undeclared constant \_LANGCODE
    Open

        $rssfile = ICMS_CACHE_PATH . '/adminnews_' . _LANGCODE . '.xml';
    Severity: Minor
    Found in htdocs/admin.php by phan

    Call to method __construct from undeclared class \icms_feeds_Simplerss
    Open

        $feed = new icms_feeds_Simplerss();
    Severity: Critical
    Found in htdocs/admin.php by phan

    Call to method get_link from undeclared class \icms_feeds_Simplerss
    Open

            $icmsAdminTpl->assign('admin_rss_feed_link', $feed->get_link());
    Severity: Critical
    Found in htdocs/admin.php by phan

    Call to method handle_content_type from undeclared class \icms_feeds_Simplerss
    Open

        $feed->handle_content_type();
    Severity: Critical
    Found in htdocs/admin.php by phan

    Call to method get_items from undeclared class \icms_feeds_Simplerss
    Open

            foreach ($feed->get_items() as $item) {
    Severity: Critical
    Found in htdocs/admin.php by phan

    Reference to undeclared constant \SIMPLEPIE_LOCATOR_NONE
    Open

        $feed->set_autodiscovery_level(SIMPLEPIE_LOCATOR_NONE);
    Severity: Minor
    Found in htdocs/admin.php by phan

    Closing brace must be on a line by itself
    Open

    if (!empty($_POST['op'])) {$op = (int) ($_POST['op']);}
    Severity: Minor
    Found in htdocs/admin.php by phpcodesniffer

    Newline required after opening brace
    Open

    if (!empty($_POST['op'])) {$op = (int) ($_POST['op']);}
    Severity: Minor
    Found in htdocs/admin.php by phpcodesniffer

    Closing brace must be on a line by itself
    Open

    if (!empty($_GET['op'])) {$op = (int) ($_GET['op']);}
    Severity: Minor
    Found in htdocs/admin.php by phpcodesniffer

    Newline required after opening brace
    Open

    if (!empty($_GET['op'])) {$op = (int) ($_GET['op']);}
    Severity: Minor
    Found in htdocs/admin.php by phpcodesniffer

    There are no issues that match your filters.

    Category
    Status