ImpressCMS/impresscms

View on GitHub
htdocs/pmlite.php

Summary

Maintainability
A
2 hrs
Test Coverage

Call to method setToEmails from undeclared class \icms_messaging_Handler
Open

                    $xoopsMailer->setToEmails($toUser->getVar('email'));
Severity: Critical
Found in htdocs/pmlite.php by phan

Reference to undeclared constant \_PM_ORCLOSEWINDOW
Open

                    . _PM_CLICKHERE . "</a><br /><br /><a href=\"javascript:window.close();\">" . _PM_ORCLOSEWINDOW . "</a></div>";
Severity: Minor
Found in htdocs/pmlite.php by phan

Call to method __construct from undeclared class \icms_messaging_Handler
Open

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

Reference to static property user from undeclared class \icms
Open

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

Call to method filterHTMLinput from undeclared class \icms_core_DataFilter
Open

            $pm->setVar("msg_text", icms_core_DataFilter::filterHTMLinput($_POST['message'], TRUE, TRUE, TRUE));
Severity: Critical
Found in htdocs/pmlite.php by phan

Reference to undeclared constant \_PM_GOBACK
Open

            echo "[ <a href='javascript:history.go(-1)'>" . _PM_GOBACK . "</a> ]</div>";
Severity: Minor
Found in htdocs/pmlite.php by phan

Reference to static property security from undeclared class \icms
Open

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

Call to method setFromName from undeclared class \icms_messaging_Handler
Open

                        $xoopsMailer->setFromName(icms::$user->getVar('uname'));
Severity: Critical
Found in htdocs/pmlite.php by phan

Call to method setTemplate from undeclared class \icms_messaging_Handler
Open

                    $xoopsMailer->setTemplate('new_pm.tpl');
Severity: Critical
Found in htdocs/pmlite.php by phan

Call to method assign from undeclared class \icms_messaging_Handler
Open

                    $xoopsMailer->assign('X_MESSAGE', icms_core_DataFilter::stripSlashesGPC($_POST['message']));
Severity: Critical
Found in htdocs/pmlite.php by phan

Reference to static property user from undeclared class \icms
Open

            if ($pm->getVar("to_userid") == (int) (icms::$user->getVar('uid'))) {
Severity: Critical
Found in htdocs/pmlite.php by phan

Call to method render from undeclared class \icms_form_elements_select_User
Open

            echo "<td class='even'>" . $user_sel->render() . "</td>";
Severity: Critical
Found in htdocs/pmlite.php by phan

Call to method __construct from undeclared class \icms_form_elements_Dhtmltextarea
Open

            $textarea = new icms_form_elements_Dhtmltextarea(_PM_MESSAGEC, 'message', $message);
Severity: Critical
Found in htdocs/pmlite.php by phan

Reference to static property user from undeclared class \icms
Open

                    if (icms::$user->getVar('user_viewemail')) {
Severity: Critical
Found in htdocs/pmlite.php by phan

Call to method setFromEmail from undeclared class \icms_messaging_Handler
Open

                        $xoopsMailer->setFromEmail(icms::$user->getVar('email'));
Severity: Critical
Found in htdocs/pmlite.php by phan

Call to method assign from undeclared class \icms_messaging_Handler
Open

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

Call to method getVar on non-class type null
Open

            $subject = $pm->getVar('subject', 'E');
Severity: Critical
Found in htdocs/pmlite.php by phan

Call to method getUnameFromId from undeclared class \icms_member_user_Object
Open

                $pm_uname = icms_member_user_Object::getUnameFromId($pm->getVar("from_userid"));
Severity: Critical
Found in htdocs/pmlite.php by phan

Call to method setFromEmail from undeclared class \icms_messaging_Handler
Open

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

Reference to undeclared constant \_PM_SUBMIT
Open

            . "<input type='submit' class='formButton' name='submit' value='" . _PM_SUBMIT
Severity: Minor
Found in htdocs/pmlite.php by phan

Reference to static property xoopsDB from undeclared class \icms
Open

        $res = icms::$xoopsDB->query("SELECT COUNT(*) FROM " . icms::$xoopsDB->prefix("users")
Severity: Critical
Found in htdocs/pmlite.php by phan

Reference to static property xoopsDB from undeclared class \icms
Open

        list($count) = icms::$xoopsDB->fetchRow($res);
Severity: Critical
Found in htdocs/pmlite.php by phan

Call to method filterTextareaInput from undeclared class \icms_core_DataFilter
Open

            $pm->setVar("subject", icms_core_DataFilter::filterTextareaInput($_POST['subject']));
Severity: Critical
Found in htdocs/pmlite.php by phan

Reference to static property user from undeclared class \icms
Open

            $pm->setVar("from_userid", (int) (icms::$user->getVar("uid")));
Severity: Critical
Found in htdocs/pmlite.php by phan

Call to method stripSlashesGPC from undeclared class \icms_core_DataFilter
Open

                    $xoopsMailer->assign('X_SUBJECT', icms_core_DataFilter::stripSlashesGPC($_POST['subject']));
Severity: Critical
Found in htdocs/pmlite.php by phan

Call to method send from undeclared class \icms_messaging_Handler
Open

                    $xoopsMailer->send();
Severity: Critical
Found in htdocs/pmlite.php by phan

Suspicious type null of a variable or expression used to build a string. (Expected type to be able to cast to a string)
Open

            echo "<td class='even'><input type='hidden' name='to_userid' value='" . $pm->getVar("from_userid") . "' />" . $pm_uname . "</td>";
Severity: Minor
Found in htdocs/pmlite.php by phan

Reference to undeclared constant \_PM_USERWROTE
Open

                    . sprintf(_PM_USERWROTE, $pm_uname)
Severity: Minor
Found in htdocs/pmlite.php by phan

Reference to undeclared constant \_PM_USERNOEXIST
Open

            echo "<br /><br /><div><h4>" . _PM_USERNOEXIST . "<br />"
Severity: Minor
Found in htdocs/pmlite.php by phan

Call to method handler from undeclared class \icms
Open

            $pm_handler = icms::handler('icms_data_privmessage');
Severity: Critical
Found in htdocs/pmlite.php by phan

Call to method getUnameFromId from undeclared class \icms_member_user_Object
Open

                $pm_uname = icms_member_user_Object::getUnameFromId($pm->getVar("from_userid"));
Severity: Critical
Found in htdocs/pmlite.php by phan

Call to method __construct from undeclared class \icms_form_elements_Dhtmltextarea
Open

            $textarea = new icms_form_elements_Dhtmltextarea(_PM_MESSAGEC, 'message', '');
Severity: Critical
Found in htdocs/pmlite.php by phan

Reference to undeclared constant \_PM_PLZTRYAGAIN
Open

                . _PM_PLZTRYAGAIN . "</h4><br />";
Severity: Minor
Found in htdocs/pmlite.php by phan

Call to method getVar on non-class type null
Open

            echo "<td class='even'><input type='hidden' name='to_userid' value='" . $pm->getVar("from_userid") . "' />" . $pm_uname . "</td>";
Severity: Critical
Found in htdocs/pmlite.php by phan

Call to method assign from undeclared class \icms_messaging_Handler
Open

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

Call to method __construct from undeclared class \icms_form_elements_select_User
Open

            $user_sel = new icms_form_elements_select_User("", "to_userid");
Severity: Critical
Found in htdocs/pmlite.php by phan

Reference to undeclared constant \_PM_SUBJECTC
Open

        echo "</tr><tr><td class='head' width='25%'>" . _PM_SUBJECTC . "</td>";
Severity: Minor
Found in htdocs/pmlite.php by phan

Reference to static property user from undeclared class \icms
Open

                        $xoopsMailer->setFromName(icms::$user->getVar('uname'));
Severity: Critical
Found in htdocs/pmlite.php by phan

Call to method assign from undeclared class \icms_messaging_Handler
Open

                    $xoopsMailer->assign('X_SUBJECT', icms_core_DataFilter::stripSlashesGPC($_POST['subject']));
Severity: Critical
Found in htdocs/pmlite.php by phan

Call to method stripSlashesGPC from undeclared class \icms_core_DataFilter
Open

                    $xoopsMailer->assign('X_MESSAGE', icms_core_DataFilter::stripSlashesGPC($_POST['message']));
Severity: Critical
Found in htdocs/pmlite.php by phan

Reference to undeclared constant \_PM_USERWROTE
Open

                    . sprintf(_PM_USERWROTE, $pm_uname)
Severity: Minor
Found in htdocs/pmlite.php by phan

Call to method render from undeclared class \icms_form_elements_Dhtmltextarea
Open

        echo $textarea->render()
Severity: Critical
Found in htdocs/pmlite.php by phan

Reference to static property security from undeclared class \icms
Open

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

Call to method assign from undeclared class \icms_messaging_Handler
Open

                    $xoopsMailer->assign('X_FROMUNAME', icms::$user->getVar('uname'));
Severity: Critical
Found in htdocs/pmlite.php by phan

Reference to static property user from undeclared class \icms
Open

                    $xoopsMailer->assign('X_FROMUNAME', icms::$user->getVar('uname'));
Severity: Critical
Found in htdocs/pmlite.php by phan

Call to method handler from undeclared class \icms
Open

            $pm_handler = icms::handler('icms_data_privmessage');
Severity: Critical
Found in htdocs/pmlite.php by phan

Reference to undeclared constant \_PM_MESSAGEC
Open

            $textarea = new icms_form_elements_Dhtmltextarea(_PM_MESSAGEC, 'message', '');
Severity: Minor
Found in htdocs/pmlite.php by phan

Reference to undeclared constant \_PM_REGISTERNOW
Open

    echo "<div>" . _PM_SORRY . "<br /><br /><a href='" . ICMS_URL . "/register.php'>" . _PM_REGISTERNOW . "</a> . </div>";
Severity: Minor
Found in htdocs/pmlite.php by phan

Reference to undeclared constant \_PM_GOBACK
Open

                    . _PM_GOBACK . "</a>";
Severity: Minor
Found in htdocs/pmlite.php by phan

Call to method useMail from undeclared class \icms_messaging_Handler
Open

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

Reference to static property user from undeclared class \icms
Open

                        $xoopsMailer->setFromEmail(icms::$user->getVar('email'));
Severity: Critical
Found in htdocs/pmlite.php by phan

Call to method assign from undeclared class \icms_messaging_Handler
Open

                    $xoopsMailer->assign('X_UNAME', $toUser->getVar('uname'));
Severity: Critical
Found in htdocs/pmlite.php by phan

Reference to undeclared constant \_PM_MESSAGEPOSTED
Open

                echo "<br /><br /><div style='text-align:center;'><h4>" . _PM_MESSAGEPOSTED
Severity: Minor
Found in htdocs/pmlite.php by phan

Call to method handler from undeclared class \icms
Open

            $pm_handler = icms::handler('icms_data_privmessage');
Severity: Critical
Found in htdocs/pmlite.php by phan

Reference to undeclared constant \_PM_MESSAGEPOSTED_EMAILSUBJ
Open

                    $xoopsMailer->setSubject(sprintf(_PM_MESSAGEPOSTED_EMAILSUBJ, $icmsConfig['sitename']));
Severity: Minor
Found in htdocs/pmlite.php by phan

Variable $icmsConfig is undeclared
Open

                    $xoopsMailer->setSubject(sprintf(_PM_MESSAGEPOSTED_EMAILSUBJ, $icmsConfig['sitename']));
Severity: Minor
Found in htdocs/pmlite.php by phan

Reference to undeclared constant \_PM_CLICKHERE
Open

                    . _PM_CLICKHERE . "</a><br /><br /><a href=\"javascript:window.close();\">" . _PM_ORCLOSEWINDOW . "</a></div>";
Severity: Minor
Found in htdocs/pmlite.php by phan

Call to method getUnameFromId from undeclared class \icms_member_user_Object
Open

            $to_username = icms_member_user_Object::getUnameFromId($to_userid);
Severity: Critical
Found in htdocs/pmlite.php by phan

Reference to static property security from undeclared class \icms
Open

            . "<input type='hidden' name='op' value='submit' />" . icms::$security->getTokenHTML()
Severity: Critical
Found in htdocs/pmlite.php by phan

Reference to undeclared constant \_PM_SORRY
Open

    echo "<div>" . _PM_SORRY . "<br /><br /><a href='" . ICMS_URL . "/register.php'>" . _PM_REGISTERNOW . "</a> . </div>";
Severity: Minor
Found in htdocs/pmlite.php by phan

Call to method handler from undeclared class \icms
Open

                $userHandler = icms::handler('icms_member_user');
Severity: Critical
Found in htdocs/pmlite.php by phan

Call to method assign from undeclared class \icms_messaging_Handler
Open

                    $xoopsMailer->assign('X_SITEURL', ICMS_URL . "/");
Severity: Critical
Found in htdocs/pmlite.php by phan

Call to method assign from undeclared class \icms_messaging_Handler
Open

                    $xoopsMailer->assign('X_ITEM_URL', ICMS_URL . "/viewpmsg.php");
Severity: Critical
Found in htdocs/pmlite.php by phan

Reference to undeclared constant \_PM_CLEAR
Open

            . "' />&nbsp;<input type='reset' class='formButton' value='" . _PM_CLEAR
Severity: Minor
Found in htdocs/pmlite.php by phan

Reference to undeclared constant \_PM_MESSAGEC
Open

            . _PM_MESSAGEC . "</td><td class='even'>";
Severity: Minor
Found in htdocs/pmlite.php by phan

Reference to undeclared constant \_PM_MESSAGEC
Open

            $textarea = new icms_form_elements_Dhtmltextarea(_PM_MESSAGEC, 'message', $message);
Severity: Minor
Found in htdocs/pmlite.php by phan

Call to method setFromName from undeclared class \icms_messaging_Handler
Open

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

Reference to undeclared constant \_PM_CANCELSEND
Open

            . "' />&nbsp;<input type='button' class='formButton' name='cancel' value='" . _PM_CANCELSEND
Severity: Minor
Found in htdocs/pmlite.php by phan

Call to method setSubject from undeclared class \icms_messaging_Handler
Open

                    $xoopsMailer->setSubject(sprintf(_PM_MESSAGEPOSTED_EMAILSUBJ, $icmsConfig['sitename']));
Severity: Critical
Found in htdocs/pmlite.php by phan

Reference to undeclared constant \_PM_TO
Open

            . _PM_TO . "</td>";
Severity: Minor
Found in htdocs/pmlite.php by phan

Reference to static property user from undeclared class \icms
Open

            if ($pm->getVar("to_userid") == (int) (icms::$user->getVar('uid'))) {
Severity: Critical
Found in htdocs/pmlite.php by phan

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

            if ($pm->getVar("to_userid") == (int) (icms::$user->getVar('uid'))) {
                $pm_uname = icms_member_user_Object::getUnameFromId($pm->getVar("from_userid"));
                $message  = "[quote]\n"
                    . sprintf(_PM_USERWROTE, $pm_uname)
                    . "\n" . $pm->getVar("msg_text", "E") . "\n[/quote]";
Severity: Major
Found in htdocs/pmlite.php and 1 other location - About 1 hr to fix
htdocs/pmlite.php on lines 125..133

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

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

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

            if ($pm->getVar("to_userid") == (int) (icms::$user->getVar('uid'))) {
                $pm_uname = icms_member_user_Object::getUnameFromId($pm->getVar("from_userid"));
                $message  = "[quote]\n"
                    . sprintf(_PM_USERWROTE, $pm_uname)
                    . "\n" . $pm->getVar("msg_text", "E") . "\n[/quote]";
Severity: Major
Found in htdocs/pmlite.php and 1 other location - About 1 hr to fix
htdocs/pmlite.php on lines 163..171

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

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 "true" but found "TRUE"
Open

            $pm->setVar("msg_text", icms_core_DataFilter::filterHTMLinput($_POST['message'], TRUE, TRUE, TRUE));
Severity: Minor
Found in htdocs/pmlite.php by phpcodesniffer

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

            $pm->setVar("msg_text", icms_core_DataFilter::filterHTMLinput($_POST['message'], TRUE, TRUE, TRUE));
Severity: Minor
Found in htdocs/pmlite.php by phpcodesniffer

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

            $pm->setVar("msg_text", icms_core_DataFilter::filterHTMLinput($_POST['message'], TRUE, TRUE, TRUE));
Severity: Minor
Found in htdocs/pmlite.php by phpcodesniffer

There are no issues that match your filters.

Category
Status