ImpressCMS/impresscms

View on GitHub
htdocs/notifications.php

Summary

Maintainability
A
2 hrs
Test Coverage

Avoid deeply nested control flow statements.
Open

                        if (file_exists($lookup_file)) {
                            include_once $lookup_file;
                            if (!empty($not_config['lookup_func']) && function_exists($not_config['lookup_func'])) {
                                $lookup_func = $not_config['lookup_func'];
                            }
Severity: Major
Found in htdocs/notifications.php - About 45 mins to fix

    TODO found
    Open

                // TODO: it would also be useful to provide links to other available
    Severity: Minor
    Found in htdocs/notifications.php by fixme

    TODO found
    Open

                        // TODO: note, we could auto-generate the url from the id
    Severity: Minor
    Found in htdocs/notifications.php by fixme

    FIXME found
    Open

                // FIXME: does this always go back to correct location??
    Severity: Minor
    Found in htdocs/notifications.php by fixme

    TODO found
    Open

                // TODO: need to span over multiple pages...???
    Severity: Minor
    Found in htdocs/notifications.php by fixme

    TODO found
    Open

                // TODO: option to specify one-time??? or other modes??
    Severity: Minor
    Found in htdocs/notifications.php by fixme

    TODO found
    Open

                // TODO: another display mode... instead of one notification per line,
    Severity: Minor
    Found in htdocs/notifications.php by fixme

    FIXME found
    Open

                // FIXME: There is a problem here... in icms_core_Message::confirm it treats arrays as
    Severity: Minor
    Found in htdocs/notifications.php by fixme

    Reference to undeclared constant \_NOT_CATEGORY
    Open

                $xoopsTpl->assign('lang_category', _NOT_CATEGORY);
    Severity: Minor
    Found in htdocs/notifications.php by phan

    Reference to undeclared constant \_NOT_ITEMID
    Open

                $xoopsTpl->assign('lang_itemid', _NOT_ITEMID);
    Severity: Minor
    Found in htdocs/notifications.php by phan

    Variable $xoopsTpl is undeclared
    Open

                $xoopsTpl->assign('lang_itemname', _NOT_ITEMNAME);
    Severity: Minor
    Found in htdocs/notifications.php by phan

    Reference to undeclared constant \_CANCEL
    Open

                $xoopsTpl->assign('lang_cancel', _CANCEL);
    Severity: Minor
    Found in htdocs/notifications.php by phan

    Reference to undeclared constant \_NOT_RUSUREDEL
    Open

                icms_core_Message::confirm($hidden_vars, '', _NOT_RUSUREDEL);
    Severity: Minor
    Found in htdocs/notifications.php by phan

    Call to method handler from undeclared class \icms
    Open

                $notification_handler = icms::handler('icms_data_notification');
    Severity: Critical
    Found in htdocs/notifications.php by phan

    Reference to static property security from undeclared class \icms
    Open

                    redirect_header('notifications.php', 2, implode('<br />', icms::$security->getErrors()));
    Severity: Critical
    Found in htdocs/notifications.php by phan

    Variable $xoopsTpl is undeclared
    Open

                $xoopsTpl->assign('lang_checkall', _NOT_CHECKALL);
    Severity: Minor
    Found in htdocs/notifications.php by phan

    Call to method handler from undeclared class \icms
    Open

                $notification_handler = icms::handler('icms_data_notification');
    Severity: Critical
    Found in htdocs/notifications.php by phan

    Reference to static property user from undeclared class \icms
    Open

    if (empty(icms::$user)) {
    Severity: Critical
    Found in htdocs/notifications.php by phan

    Variable $xoopsTpl is undeclared
    Open

                $xoopsTpl->assign('lang_events', _NOT_EVENTS);
    Severity: Minor
    Found in htdocs/notifications.php by phan

    Reference to undeclared constant \_NOT_ACTIVENOTIFICATIONS
    Open

                $xoopsTpl->assign('lang_activenotifications', _NOT_ACTIVENOTIFICATIONS);
    Severity: Minor
    Found in htdocs/notifications.php by phan

    Reference to undeclared constant \_NOT_NOACCESS
    Open

        redirect_header('index.php', 3, _NOT_NOACCESS);
    Severity: Minor
    Found in htdocs/notifications.php by phan

    Call to method setSort from undeclared class \icms_db_criteria_Item
    Open

                $criteria->setSort('not_modid,not_category,not_itemid');
    Severity: Critical
    Found in htdocs/notifications.php by phan

    Reference to undeclared constant \_NOT_EVENT
    Open

                $xoopsTpl->assign('lang_event', _NOT_EVENT);
    Severity: Minor
    Found in htdocs/notifications.php by phan

    Variable $xoopsTpl is undeclared
    Open

                $xoopsTpl->assign('lang_itemid', _NOT_ITEMID);
    Severity: Minor
    Found in htdocs/notifications.php by phan

    Reference to static property user from undeclared class \icms
    Open

    $uid = (int) icms::$user->getVar('uid');
    Severity: Critical
    Found in htdocs/notifications.php by phan

    Variable $xoopsTpl is undeclared
    Open

                $xoopsTpl->assign('lang_module', _NOT_MODULE);
    Severity: Minor
    Found in htdocs/notifications.php by phan

    Reference to undeclared constant \_NOT_EVENTS
    Open

                $xoopsTpl->assign('lang_events', _NOT_EVENTS);
    Severity: Minor
    Found in htdocs/notifications.php by phan

    Call to method confirm from undeclared class \icms_core_Message
    Open

                icms_core_Message::confirm($hidden_vars, '', _NOT_RUSUREDEL);
    Severity: Critical
    Found in htdocs/notifications.php by phan

    Variable $xoopsTpl is undeclared
    Open

                $xoopsTpl->assign('lang_cancel', _CANCEL);
    Severity: Minor
    Found in htdocs/notifications.php by phan

    Variable $xoopsTpl is undeclared
    Open

                $xoopsTpl->assign('lang_clear', _NOT_CLEAR);
    Severity: Minor
    Found in htdocs/notifications.php by phan

    Variable $xoopsTpl is undeclared
    Open

                $xoopsTpl->assign('lang_category', _NOT_CATEGORY);
    Severity: Minor
    Found in htdocs/notifications.php by phan

    Suspicious array access to nullable ?array
    Open

                $hidden_vars = array('uid'=>$uid, 'delete_ok'=>1, 'del_not'=>$_POST['del_not']);
    Severity: Minor
    Found in htdocs/notifications.php by phan

    Variable $xoopsTpl is undeclared
    Open

                $xoopsTpl->assign('user', $user_info);
    Severity: Minor
    Found in htdocs/notifications.php by phan

    Reference to undeclared constant \_NOT_DELETESUCCESS
    Open

                redirect_header('notifications.php', 2, _NOT_DELETESUCCESS);
    Severity: Minor
    Found in htdocs/notifications.php by phan

    Call to method __construct from undeclared class \icms_db_criteria_Item
    Open

                $criteria = new icms_db_criteria_Item('not_uid', $uid);
    Severity: Critical
    Found in htdocs/notifications.php by phan

    Reference to undeclared constant \_NOT_NAMENOTAVAILABLE
    Open

                            $item_info = array('name'=>'[' . _NOT_NAMENOTAVAILABLE . ']', 'url'=>'');
    Severity: Minor
    Found in htdocs/notifications.php by phan

    Reference to static property security from undeclared class \icms
    Open

                $xoopsTpl->assign('notification_token', icms::$security->createToken());
    Severity: Critical
    Found in htdocs/notifications.php by phan

    Call to method handler from undeclared class \icms
    Open

                $module_handler = icms::handler('icms_module');
    Severity: Critical
    Found in htdocs/notifications.php by phan

    Variable $xoopsTpl is undeclared
    Open

                $xoopsTpl->assign('lang_delete', _DELETE);
    Severity: Minor
    Found in htdocs/notifications.php by phan

    Reference to undeclared constant \_NOT_MODULE
    Open

                $xoopsTpl->assign('lang_module', _NOT_MODULE);
    Severity: Minor
    Found in htdocs/notifications.php by phan

    Variable $xoopsTpl is undeclared
    Open

                $xoopsTpl->assign('notification_token', icms::$security->createToken());
    Severity: Minor
    Found in htdocs/notifications.php by phan

    Reference to undeclared constant \_NOT_NOTHINGTODELETE
    Open

                    redirect_header('notifications.php', 2, _NOT_NOTHINGTODELETE);
    Severity: Minor
    Found in htdocs/notifications.php by phan

    Reference to undeclared constant \_NOT_NOTHINGTODELETE
    Open

                    redirect_header('notifications.php', 2, _NOT_NOTHINGTODELETE);
    Severity: Minor
    Found in htdocs/notifications.php by phan

    Variable $xoopsTpl is undeclared
    Open

                $xoopsTpl->assign('modules', $modules);
    Severity: Minor
    Found in htdocs/notifications.php by phan

    Reference to undeclared constant \_DELETE
    Open

                $xoopsTpl->assign('lang_delete', _DELETE);
    Severity: Minor
    Found in htdocs/notifications.php by phan

    Reference to undeclared constant \_NOT_CHECKALL
    Open

                $xoopsTpl->assign('lang_checkall', _NOT_CHECKALL);
    Severity: Minor
    Found in htdocs/notifications.php by phan

    Reference to undeclared constant \_NOT_ITEMNAME
    Open

                $xoopsTpl->assign('lang_itemname', _NOT_ITEMNAME);
    Severity: Minor
    Found in htdocs/notifications.php by phan

    Reference to static property security from undeclared class \icms
    Open

                if (!icms::$security->check()) {
    Severity: Critical
    Found in htdocs/notifications.php by phan

    Reference to static property user from undeclared class \icms
    Open

                $user_info = array('uid' => icms::$user->getVar('uid'));
    Severity: Critical
    Found in htdocs/notifications.php by phan

    Reference to undeclared constant \_NOT_CLEAR
    Open

                $xoopsTpl->assign('lang_clear', _NOT_CLEAR);
    Severity: Minor
    Found in htdocs/notifications.php by phan

    Suspicious array access to nullable ?array
    Open

                foreach ($_POST['del_not'] as $n_array) {
    Severity: Minor
    Found in htdocs/notifications.php by phan

    Variable $xoopsTpl is undeclared
    Open

                $xoopsTpl->assign('lang_event', _NOT_EVENT);
    Severity: Minor
    Found in htdocs/notifications.php by phan

    Variable $xoopsTpl is undeclared
    Open

                $xoopsTpl->assign('lang_activenotifications', _NOT_ACTIVENOTIFICATIONS);
    Severity: Minor
    Found in htdocs/notifications.php by phan

    Reference to undeclared constant \_NOT_DELETINGNOTIFICATIONS
    Open

                print '<h4>' . _NOT_DELETINGNOTIFICATIONS . '</h4>';
    Severity: Minor
    Found in htdocs/notifications.php by phan

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

                        if (!empty($not_config['lookup_file'])) {
                            $lookup_file = ICMS_ROOT_PATH . '/modules/' . $module->getVar('dirname') . '/' . $not_config['lookup_file'];
                            if (file_exists($lookup_file)) {
                                include_once $lookup_file;
                                if (!empty($not_config['lookup_func']) && function_exists($not_config['lookup_func'])) {
    Severity: Major
    Found in htdocs/notifications.php and 1 other location - About 1 hr to fix
    htdocs/modules/system/blocks/system_blocks.php on lines 667..675

    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 105.

    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

    Further Reading

    TRUE, FALSE and NULL must be lowercase; expected "null" but found "NULL"
    Open

    $valid_op = array('cancel', 'list', 'delete', 'delete_ok', '', NULL);
    Severity: Minor
    Found in htdocs/notifications.php by phpcodesniffer

    Expected 1 blank line at end of file; 2 found
    Open

    }
    Severity: Minor
    Found in htdocs/notifications.php by phpcodesniffer

    Unexpected trailing spaces found.
    Open

        
    Severity: Minor
    Found in htdocs/notifications.php by editorconfig

    Unexpected trailing spaces found.
    Open

        
    Severity: Minor
    Found in htdocs/notifications.php by editorconfig

    Unexpected trailing spaces found.
    Open

        
    Severity: Minor
    Found in htdocs/notifications.php by editorconfig

    Unexpected trailing spaces found.
    Open

        
    Severity: Minor
    Found in htdocs/notifications.php by editorconfig

    Unexpected trailing spaces found.
    Open

        
    Severity: Minor
    Found in htdocs/notifications.php by editorconfig

    Unexpected trailing spaces found.
    Open

        
    Severity: Minor
    Found in htdocs/notifications.php by editorconfig

    Unexpected trailing spaces found.
    Open

        
    Severity: Minor
    Found in htdocs/notifications.php by editorconfig

    Unexpected trailing spaces found.
    Open

        
    Severity: Minor
    Found in htdocs/notifications.php by editorconfig

    Unexpected trailing spaces found.
    Open

        
    Severity: Minor
    Found in htdocs/notifications.php by editorconfig

    Unexpected trailing spaces found.
    Open

        
    Severity: Minor
    Found in htdocs/notifications.php by editorconfig

    Unexpected trailing spaces found.
    Open

        
    Severity: Minor
    Found in htdocs/notifications.php by editorconfig

    Unexpected trailing spaces found.
    Open

        
    Severity: Minor
    Found in htdocs/notifications.php by editorconfig

    Unexpected trailing spaces found.
    Open

        
    Severity: Minor
    Found in htdocs/notifications.php by editorconfig

    Unexpected trailing spaces found.
    Open

    Severity: Minor
    Found in htdocs/notifications.php by editorconfig

    Unexpected trailing spaces found.
    Open

        
    Severity: Minor
    Found in htdocs/notifications.php by editorconfig

    Unexpected trailing spaces found.
    Open

        
    Severity: Minor
    Found in htdocs/notifications.php by editorconfig

    Unexpected trailing spaces found.
    Open

        
    Severity: Minor
    Found in htdocs/notifications.php by editorconfig

    Unexpected trailing spaces found.
    Open

        
    Severity: Minor
    Found in htdocs/notifications.php by editorconfig

    Unexpected trailing spaces found.
    Open

        
    Severity: Minor
    Found in htdocs/notifications.php by editorconfig

    There are no issues that match your filters.

    Category
    Status