Call to method setToEmails
from undeclared class \icms_messaging_Handler
Open
$xoopsMailer->setToEmails($toUser->getVar('email'));
- Exclude checks
Reference to undeclared constant \_PM_ORCLOSEWINDOW
Open
. _PM_CLICKHERE . "</a><br /><br /><a href=\"javascript:window.close();\">" . _PM_ORCLOSEWINDOW . "</a></div>";
- Exclude checks
Call to method __construct
from undeclared class \icms_messaging_Handler
Open
$xoopsMailer = new icms_messaging_Handler();
- Exclude checks
Reference to static property user
from undeclared class \icms
Open
if (icms::$user) {
- Exclude checks
Call to method filterHTMLinput
from undeclared class \icms_core_DataFilter
Open
$pm->setVar("msg_text", icms_core_DataFilter::filterHTMLinput($_POST['message'], TRUE, TRUE, TRUE));
- Exclude checks
Reference to undeclared constant \_PM_GOBACK
Open
echo "[ <a href='javascript:history.go(-1)'>" . _PM_GOBACK . "</a> ]</div>";
- Exclude checks
Reference to static property security
from undeclared class \icms
Open
echo implode('<br />', icms::$security->getErrors());
- Exclude checks
Call to method setFromName
from undeclared class \icms_messaging_Handler
Open
$xoopsMailer->setFromName(icms::$user->getVar('uname'));
- Exclude checks
Call to method setTemplate
from undeclared class \icms_messaging_Handler
Open
$xoopsMailer->setTemplate('new_pm.tpl');
- Exclude checks
Call to method assign
from undeclared class \icms_messaging_Handler
Open
$xoopsMailer->assign('X_MESSAGE', icms_core_DataFilter::stripSlashesGPC($_POST['message']));
- Exclude checks
Reference to static property user
from undeclared class \icms
Open
if ($pm->getVar("to_userid") == (int) (icms::$user->getVar('uid'))) {
- Exclude checks
Call to method render
from undeclared class \icms_form_elements_select_User
Open
echo "<td class='even'>" . $user_sel->render() . "</td>";
- Exclude checks
Call to method __construct
from undeclared class \icms_form_elements_Dhtmltextarea
Open
$textarea = new icms_form_elements_Dhtmltextarea(_PM_MESSAGEC, 'message', $message);
- Exclude checks
Reference to static property user
from undeclared class \icms
Open
if (icms::$user->getVar('user_viewemail')) {
- Exclude checks
Call to method setFromEmail
from undeclared class \icms_messaging_Handler
Open
$xoopsMailer->setFromEmail(icms::$user->getVar('email'));
- Exclude checks
Call to method assign
from undeclared class \icms_messaging_Handler
Open
$xoopsMailer->assign('X_SITENAME', $icmsConfig['sitename']);
- Exclude checks
Call to method getVar
on non-class type null
Open
$subject = $pm->getVar('subject', 'E');
- Exclude checks
Call to method getUnameFromId
from undeclared class \icms_member_user_Object
Open
$pm_uname = icms_member_user_Object::getUnameFromId($pm->getVar("from_userid"));
- Exclude checks
Call to method setFromEmail
from undeclared class \icms_messaging_Handler
Open
$xoopsMailer->setFromEmail($icmsConfig['adminmail']);
- Exclude checks
Reference to undeclared constant \_PM_SUBMIT
Open
. "<input type='submit' class='formButton' name='submit' value='" . _PM_SUBMIT
- Exclude checks
Reference to static property xoopsDB
from undeclared class \icms
Open
$res = icms::$xoopsDB->query("SELECT COUNT(*) FROM " . icms::$xoopsDB->prefix("users")
- Exclude checks
Reference to static property xoopsDB
from undeclared class \icms
Open
list($count) = icms::$xoopsDB->fetchRow($res);
- Exclude checks
Call to method filterTextareaInput
from undeclared class \icms_core_DataFilter
Open
$pm->setVar("subject", icms_core_DataFilter::filterTextareaInput($_POST['subject']));
- Exclude checks
Reference to static property user
from undeclared class \icms
Open
$pm->setVar("from_userid", (int) (icms::$user->getVar("uid")));
- Exclude checks
Call to method stripSlashesGPC
from undeclared class \icms_core_DataFilter
Open
$xoopsMailer->assign('X_SUBJECT', icms_core_DataFilter::stripSlashesGPC($_POST['subject']));
- Exclude checks
Call to method send
from undeclared class \icms_messaging_Handler
Open
$xoopsMailer->send();
- Exclude checks
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>";
- Exclude checks
Reference to undeclared constant \_PM_USERWROTE
Open
. sprintf(_PM_USERWROTE, $pm_uname)
- Exclude checks
Reference to undeclared constant \_PM_USERNOEXIST
Open
echo "<br /><br /><div><h4>" . _PM_USERNOEXIST . "<br />"
- Exclude checks
Call to method handler
from undeclared class \icms
Open
$pm_handler = icms::handler('icms_data_privmessage');
- Exclude checks
Call to method getUnameFromId
from undeclared class \icms_member_user_Object
Open
$pm_uname = icms_member_user_Object::getUnameFromId($pm->getVar("from_userid"));
- Exclude checks
Call to method __construct
from undeclared class \icms_form_elements_Dhtmltextarea
Open
$textarea = new icms_form_elements_Dhtmltextarea(_PM_MESSAGEC, 'message', '');
- Exclude checks
Reference to undeclared constant \_PM_PLZTRYAGAIN
Open
. _PM_PLZTRYAGAIN . "</h4><br />";
- Exclude checks
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>";
- Exclude checks
Call to method assign
from undeclared class \icms_messaging_Handler
Open
$xoopsMailer->assign('X_ADMINMAIL', $icmsConfig['adminmail']);
- Exclude checks
Call to method __construct
from undeclared class \icms_form_elements_select_User
Open
$user_sel = new icms_form_elements_select_User("", "to_userid");
- Exclude checks
Reference to undeclared constant \_PM_SUBJECTC
Open
echo "</tr><tr><td class='head' width='25%'>" . _PM_SUBJECTC . "</td>";
- Exclude checks
Reference to static property user
from undeclared class \icms
Open
$xoopsMailer->setFromName(icms::$user->getVar('uname'));
- Exclude checks
Call to method assign
from undeclared class \icms_messaging_Handler
Open
$xoopsMailer->assign('X_SUBJECT', icms_core_DataFilter::stripSlashesGPC($_POST['subject']));
- Exclude checks
Call to method stripSlashesGPC
from undeclared class \icms_core_DataFilter
Open
$xoopsMailer->assign('X_MESSAGE', icms_core_DataFilter::stripSlashesGPC($_POST['message']));
- Exclude checks
Reference to undeclared constant \_PM_USERWROTE
Open
. sprintf(_PM_USERWROTE, $pm_uname)
- Exclude checks
Call to method render
from undeclared class \icms_form_elements_Dhtmltextarea
Open
echo $textarea->render()
- Exclude checks
Reference to static property security
from undeclared class \icms
Open
if (!icms::$security->check()) {
- Exclude checks
Call to method assign
from undeclared class \icms_messaging_Handler
Open
$xoopsMailer->assign('X_FROMUNAME', icms::$user->getVar('uname'));
- Exclude checks
Reference to static property user
from undeclared class \icms
Open
$xoopsMailer->assign('X_FROMUNAME', icms::$user->getVar('uname'));
- Exclude checks
Call to method handler
from undeclared class \icms
Open
$pm_handler = icms::handler('icms_data_privmessage');
- Exclude checks
Reference to undeclared constant \_PM_MESSAGEC
Open
$textarea = new icms_form_elements_Dhtmltextarea(_PM_MESSAGEC, 'message', '');
- Exclude checks
Reference to undeclared constant \_PM_REGISTERNOW
Open
echo "<div>" . _PM_SORRY . "<br /><br /><a href='" . ICMS_URL . "/register.php'>" . _PM_REGISTERNOW . "</a> . </div>";
- Exclude checks
Reference to undeclared constant \_PM_GOBACK
Open
. _PM_GOBACK . "</a>";
- Exclude checks
Call to method useMail
from undeclared class \icms_messaging_Handler
Open
$xoopsMailer->useMail();
- Exclude checks
Reference to static property user
from undeclared class \icms
Open
$xoopsMailer->setFromEmail(icms::$user->getVar('email'));
- Exclude checks
Call to method assign
from undeclared class \icms_messaging_Handler
Open
$xoopsMailer->assign('X_UNAME', $toUser->getVar('uname'));
- Exclude checks
Reference to undeclared constant \_PM_MESSAGEPOSTED
Open
echo "<br /><br /><div style='text-align:center;'><h4>" . _PM_MESSAGEPOSTED
- Exclude checks
Call to method handler
from undeclared class \icms
Open
$pm_handler = icms::handler('icms_data_privmessage');
- Exclude checks
Reference to undeclared constant \_PM_MESSAGEPOSTED_EMAILSUBJ
Open
$xoopsMailer->setSubject(sprintf(_PM_MESSAGEPOSTED_EMAILSUBJ, $icmsConfig['sitename']));
- Exclude checks
Variable $icmsConfig
is undeclared Open
$xoopsMailer->setSubject(sprintf(_PM_MESSAGEPOSTED_EMAILSUBJ, $icmsConfig['sitename']));
- Exclude checks
Reference to undeclared constant \_PM_CLICKHERE
Open
. _PM_CLICKHERE . "</a><br /><br /><a href=\"javascript:window.close();\">" . _PM_ORCLOSEWINDOW . "</a></div>";
- Exclude checks
Call to method getUnameFromId
from undeclared class \icms_member_user_Object
Open
$to_username = icms_member_user_Object::getUnameFromId($to_userid);
- Exclude checks
Reference to static property security
from undeclared class \icms
Open
. "<input type='hidden' name='op' value='submit' />" . icms::$security->getTokenHTML()
- Exclude checks
Reference to undeclared constant \_PM_SORRY
Open
echo "<div>" . _PM_SORRY . "<br /><br /><a href='" . ICMS_URL . "/register.php'>" . _PM_REGISTERNOW . "</a> . </div>";
- Exclude checks
Call to method handler
from undeclared class \icms
Open
$userHandler = icms::handler('icms_member_user');
- Exclude checks
Call to method assign
from undeclared class \icms_messaging_Handler
Open
$xoopsMailer->assign('X_SITEURL', ICMS_URL . "/");
- Exclude checks
Call to method assign
from undeclared class \icms_messaging_Handler
Open
$xoopsMailer->assign('X_ITEM_URL', ICMS_URL . "/viewpmsg.php");
- Exclude checks
Reference to undeclared constant \_PM_CLEAR
Open
. "' /> <input type='reset' class='formButton' value='" . _PM_CLEAR
- Exclude checks
Reference to undeclared constant \_PM_MESSAGEC
Open
. _PM_MESSAGEC . "</td><td class='even'>";
- Exclude checks
Reference to undeclared constant \_PM_MESSAGEC
Open
$textarea = new icms_form_elements_Dhtmltextarea(_PM_MESSAGEC, 'message', $message);
- Exclude checks
Call to method setFromName
from undeclared class \icms_messaging_Handler
Open
$xoopsMailer->setFromName($icmsConfig['sitename']);
- Exclude checks
Reference to undeclared constant \_PM_CANCELSEND
Open
. "' /> <input type='button' class='formButton' name='cancel' value='" . _PM_CANCELSEND
- Exclude checks
Call to method setSubject
from undeclared class \icms_messaging_Handler
Open
$xoopsMailer->setSubject(sprintf(_PM_MESSAGEPOSTED_EMAILSUBJ, $icmsConfig['sitename']));
- Exclude checks
Reference to undeclared constant \_PM_TO
Open
. _PM_TO . "</td>";
- Exclude checks
Reference to static property user
from undeclared class \icms
Open
if ($pm->getVar("to_userid") == (int) (icms::$user->getVar('uid'))) {
- Exclude checks
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]";
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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]";
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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));
- Exclude checks
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));
- Exclude checks
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));
- Exclude checks