ImpressCMS/impresscms

View on GitHub
htdocs/user.php

Summary

Maintainability
A
3 hrs
Test Coverage

Reference to undeclared constant \_US_RESETPASSINFO
Open

                'lang_resetpassinfo' => _US_RESETPASSINFO,
Severity: Minor
Found in htdocs/user.php by phan

Reference to undeclared constant \_US_ADMINNO
Open

                redirect_header('user.php', 5, _US_ADMINNO);
Severity: Minor
Found in htdocs/user.php by phan

Reference to static property security from undeclared class \icms
Open

                'mailpasswd_token' => icms::$security->createToken(),
Severity: Critical
Found in htdocs/user.php by phan

Reference to undeclared constant \_US_LOGGEDOUT
Open

        redirect_header(ICMS_URL . '/', 3, _US_LOGGEDOUT . '<br />' . _US_THANKYOUFORVISIT);
Severity: Minor
Found in htdocs/user.php by phan

Call to method useMail from undeclared class \icms_messaging_Handler
Open

                        $icmsMailer->useMail();
Severity: Critical
Found in htdocs/user.php by phan

Call to method assign from undeclared class \icms_messaging_Handler
Open

                        $icmsMailer->assign('SITEURL', ICMS_URL . '/');
Severity: Critical
Found in htdocs/user.php by phan

Reference to undeclared constant \_US_REMOVEINFO
Open

                ), 'user.php', _US_SURETODEL . '<br/>' . _US_REMOVEINFO);
Severity: Minor
Found in htdocs/user.php by phan

Reference to undeclared constant \_US_YOUREMAIL
Open

                'lang_youremail' => _US_YOUREMAIL,
Severity: Minor
Found in htdocs/user.php by phan

Reference to undeclared constant \_US_RESETPASSWORD
Open

                'lang_resetpassword' => _US_RESETPASSWORD,
Severity: Minor
Found in htdocs/user.php by phan

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

                        $icmsMailer->setSubject(sprintf(_US_YOURACCOUNT, $icmsConfig['sitename'], ICMS_URL));
Severity: Minor
Found in htdocs/user.php by phan

Reference to undeclared constant \_LOGIN
Open

                'icms_pagetitle' => _LOGIN
Severity: Minor
Found in htdocs/user.php by phan

Call to method handler from undeclared class \icms
Open

                    $online_handler = icms::handler('icms_core_Online');
Severity: Critical
Found in htdocs/user.php by phan

Reference to undeclared constant \_US_CURRENTPASS
Open

                'lang_currentpass' => _US_CURRENTPASS,
Severity: Minor
Found in htdocs/user.php by phan

Reference to undeclared constant \_US_ACTKEYNOT
Open

            redirect_header('index.php', 5, _US_ACTKEYNOT);
Severity: Minor
Found in htdocs/user.php by phan

Call to method setFromName from undeclared class \icms_messaging_Handler
Open

                        $icmsMailer->setFromName($icmsConfig['sitename']);
Severity: Critical
Found in htdocs/user.php by phan

Reference to undeclared constant \_US_ACTVMAILOK
Open

                            printf(_US_ACTVMAILOK, $thisuser->getVar('uname'));
Severity: Minor
Found in htdocs/user.php by phan

Reference to undeclared constant \_US_ACTLOGIN
Open

                        redirect_header('user.php', 3, _US_ACTLOGIN, FALSE);
Severity: Minor
Found in htdocs/user.php by phan

Call to method setToUsers from undeclared class \icms_messaging_Handler
Open

                        $icmsMailer->setToUsers($thisuser);
Severity: Critical
Found in htdocs/user.php by phan

Call to method setSubject from undeclared class \icms_messaging_Handler
Open

                        $icmsMailer->setSubject(sprintf(_US_YOURACCOUNT, $icmsConfig['sitename'], ICMS_URL));
Severity: Critical
Found in htdocs/user.php by phan

Reference to static property user from undeclared class \icms
Open

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

Argument 2 (variable_name) is null but \filter_input() takes string
Open

                'usercookie' => filter_input(INPUT_COOKIE, $icmsConfig['usercookie'], FILTER_SANITIZE_STRING),
Severity: Minor
Found in htdocs/user.php by phan

Reference to static property user from undeclared class \icms
Open

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

Reference to static property user from undeclared class \icms
Open

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

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

                        $icmsMailer->assign('SITENAME', $icmsConfig['sitename']);
Severity: Minor
Found in htdocs/user.php by phan

Reference to undeclared constant \_US_YOURACCOUNT
Open

                        $icmsMailer->setSubject(sprintf(_US_YOURACCOUNT, $icmsConfig['sitename'], ICMS_URL));
Severity: Minor
Found in htdocs/user.php by phan

Reference to undeclared constant \_PASSWORD
Open

                'lang_password' => _PASSWORD,
Severity: Minor
Found in htdocs/user.php by phan

Reference to undeclared constant \_US_REMEMBERME
Open

                'lang_rememberme' => _US_REMEMBERME,
Severity: Minor
Found in htdocs/user.php by phan

Call to method setFromEmail from undeclared class \icms_messaging_Handler
Open

                        $icmsMailer->setFromEmail($icmsConfig['adminmail']);
Severity: Critical
Found in htdocs/user.php by phan

Reference to undeclared constant \_US_LOSTPASSWORD
Open

                'lang_lostpassword' => _US_LOSTPASSWORD,
Severity: Minor
Found in htdocs/user.php by phan

Reference to static property security from undeclared class \icms
Open

                'resetpassword_token' => icms::$security->createToken(),
Severity: Critical
Found in htdocs/user.php by phan

Call to method assign from undeclared class \icms_messaging_Handler
Open

                        $icmsMailer->assign('ADMINMAIL', $icmsConfig['adminmail']);
Severity: Critical
Found in htdocs/user.php by phan

Reference to undeclared constant \_LOGIN
Open

                'lang_login' => _LOGIN,
Severity: Minor
Found in htdocs/user.php by phan

Reference to undeclared constant \_LOGIN
Open

                'icms_pagetitle' => _LOGIN
Severity: Minor
Found in htdocs/user.php by phan

Call to method __construct from undeclared class \icms_messaging_Handler
Open

                        $icmsMailer = new icms_messaging_Handler();
Severity: Critical
Found in htdocs/user.php by phan

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

                        $icmsMailer->setFromEmail($icmsConfig['adminmail']);
Severity: Minor
Found in htdocs/user.php by phan

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

                'usercookie' => filter_input(INPUT_COOKIE, $icmsConfig['usercookie'], FILTER_SANITIZE_STRING),
Severity: Minor
Found in htdocs/user.php by phan

Reference to undeclared constant \_US_NEWPASSWORD
Open

                'lang_newpass' => _US_NEWPASSWORD,
Severity: Minor
Found in htdocs/user.php by phan

Call to method handler from undeclared class \icms
Open

        $member_handler = icms::handler('icms_member');
Severity: Critical
Found in htdocs/user.php by phan

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

                        $icmsMailer->assign('ADMINMAIL', $icmsConfig['adminmail']);
Severity: Minor
Found in htdocs/user.php by phan

Call to method send from undeclared class \icms_messaging_Handler
Open

                        if (!$icmsMailer->send()) {
Severity: Critical
Found in htdocs/user.php by phan

Reference to undeclared constant \_US_NOTREGISTERED
Open

                'lang_notregister' => _US_NOTREGISTERED,
Severity: Minor
Found in htdocs/user.php by phan

Reference to static property user from undeclared class \icms
Open

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

Reference to undeclared constant \_US_SENDPASSWORD
Open

                'lang_sendpassword' => _US_SENDPASSWORD,
Severity: Minor
Found in htdocs/user.php by phan

Reference to undeclared constant \_US_SUBRESETPASSWORD
Open

                'lang_subresetpassword' => _US_SUBRESETPASSWORD,
Severity: Minor
Found in htdocs/user.php by phan

Reference to static property session from undeclared class \icms
Open

        $sessHandler = icms::$session;
Severity: Critical
Found in htdocs/user.php by phan

Argument 2 (vars) is null but \sprintf() takes float|int|string
Open

                        $icmsMailer->setSubject(sprintf(_US_YOURACCOUNT, $icmsConfig['sitename'], ICMS_URL));
Severity: Minor
Found in htdocs/user.php by phan

Reference to undeclared constant \_US_ACTVMAILNG
Open

                            printf(_US_ACTVMAILNG, $thisuser->getVar('uname'));
Severity: Minor
Found in htdocs/user.php by phan

Reference to static property user from undeclared class \icms
Open

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

Call to method handler from undeclared class \icms
Open

                $member_handler = icms::handler('icms_member');
Severity: Critical
Found in htdocs/user.php by phan

Reference to static property user from undeclared class \icms
Open

                if (FALSE != $member_handler->deleteUser(icms::$user)) {
Severity: Critical
Found in htdocs/user.php by phan

Reference to undeclared constant \_US_NOPERMISS
Open

                redirect_header('index.php', 5, _US_NOPERMISS);
Severity: Minor
Found in htdocs/user.php by phan

Reference to undeclared constant \_US_THANKYOUFORVISIT
Open

        redirect_header(ICMS_URL . '/', 3, _US_LOGGEDOUT . '<br />' . _US_THANKYOUFORVISIT);
Severity: Minor
Found in htdocs/user.php by phan

Reference to undeclared constant \_US_BEENDELED
Open

                    redirect_header('index.php', 5, _US_BEENDELED);
Severity: Minor
Found in htdocs/user.php by phan

Reference to undeclared constant \_USERNAME
Open

                'lang_username' => _USERNAME,
Severity: Minor
Found in htdocs/user.php by phan

Call to method assign from undeclared class \icms_messaging_Handler
Open

                        $icmsMailer->assign('SITENAME', $icmsConfig['sitename']);
Severity: Critical
Found in htdocs/user.php by phan

Reference to undeclared constant \_US_NOPROBLEM
Open

                'lang_noproblem' => _US_NOPROBLEM,
Severity: Minor
Found in htdocs/user.php by phan

Reference to undeclared constant \_US_SENDPASSWORD
Open

                'lang_sendpassword' => _US_SENDPASSWORD,
Severity: Minor
Found in htdocs/user.php by phan

Reference to undeclared constant \_US_VERIFYPASS
Open

                'lang_newpass2' => _US_VERIFYPASS,
Severity: Minor
Found in htdocs/user.php by phan

Call to method confirm from undeclared class \icms_core_Message
Open

                icms_core_Message::confirm(array (
Severity: Critical
Found in htdocs/user.php by phan

Reference to undeclared constant \_US_ACONTACT
Open

                redirect_header('user.php', 5, _US_ACONTACT, FALSE);
Severity: Minor
Found in htdocs/user.php by phan

Call to method setTemplate from undeclared class \icms_messaging_Handler
Open

                        $icmsMailer->setTemplate('activated.tpl');
Severity: Critical
Found in htdocs/user.php by phan

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

                        $icmsMailer->setFromName($icmsConfig['sitename']);
Severity: Minor
Found in htdocs/user.php by phan

Reference to undeclared constant \_US_NOPERMISS
Open

            redirect_header('index.php', 5, _US_NOPERMISS);
Severity: Minor
Found in htdocs/user.php by phan

Reference to undeclared constant \_US_SURETODEL
Open

                ), 'user.php', _US_SURETODEL . '<br/>' . _US_REMOVEINFO);
Severity: Minor
Found in htdocs/user.php by phan

Reference to static property user from undeclared class \icms
Open

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

Reference to static property user from undeclared class \icms
Open

        if (!icms::$user || $icmsConfigUser['self_delete'] != 1) {
Severity: Critical
Found in htdocs/user.php by phan

Reference to static property user from undeclared class \icms
Open

            $groups = icms::$user->getGroups();
Severity: Critical
Found in htdocs/user.php by phan

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

    if ($pos !== FALSE) {
        $icmsLocation = substr(ICMS_URL, strpos(ICMS_URL, '://') + 3);
        if (substr($redirect, $pos + 3, strlen($icmsLocation)) != $icmsLocation) {
            $redirect = ICMS_URL;
        } elseif (substr($redirect, $pos + 3, strlen($icmsLocation) + 1) == $icmsLocation . '.') {
Severity: Major
Found in htdocs/user.php and 1 other location - About 3 hrs to fix
htdocs/include/checklogin.php on lines 69..76

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

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 "false" but found "FALSE"
Open

                if (FALSE !== $member_handler->activateUser($thisuser)) {
Severity: Minor
Found in htdocs/user.php by phpcodesniffer

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

    if ($pos !== FALSE) {
Severity: Minor
Found in htdocs/user.php by phpcodesniffer

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

$redirect = (isset($_GET['xoops_redirect']) ? $_GET['xoops_redirect'] : isset($_POST['xoops_redirect'])) ? $_POST['xoops_redirect'] : FALSE;
Severity: Minor
Found in htdocs/user.php by phpcodesniffer

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

                        redirect_header('user.php', 3, _US_ACTLOGIN, FALSE);
Severity: Minor
Found in htdocs/user.php by phpcodesniffer

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

                if (FALSE != $member_handler->deleteUser(icms::$user)) {
Severity: Minor
Found in htdocs/user.php by phpcodesniffer

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

    $isExternal = FALSE;
Severity: Minor
Found in htdocs/user.php by phpcodesniffer

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

                redirect_header('user.php', 5, _US_ACONTACT, FALSE);
Severity: Minor
Found in htdocs/user.php by phpcodesniffer

Inline control structures are not allowed
Open

if ($redirect && $redirect !== htmlspecialchars($_SERVER['REQUEST_URI'])) $redirect = ICMS_URL;
Severity: Minor
Found in htdocs/user.php by phpcodesniffer

There are no issues that match your filters.

Category
Status