Reference to undeclared constant \_US_RESETPASSINFO
Open
'lang_resetpassinfo' => _US_RESETPASSINFO,
- Exclude checks
Reference to undeclared constant \_US_ADMINNO
Open
redirect_header('user.php', 5, _US_ADMINNO);
- Exclude checks
Reference to static property security
from undeclared class \icms
Open
'mailpasswd_token' => icms::$security->createToken(),
- Exclude checks
Reference to undeclared constant \_US_LOGGEDOUT
Open
redirect_header(ICMS_URL . '/', 3, _US_LOGGEDOUT . '<br />' . _US_THANKYOUFORVISIT);
- Exclude checks
Call to method useMail
from undeclared class \icms_messaging_Handler
Open
$icmsMailer->useMail();
- Exclude checks
Call to method assign
from undeclared class \icms_messaging_Handler
Open
$icmsMailer->assign('SITEURL', ICMS_URL . '/');
- Exclude checks
Reference to undeclared constant \_US_REMOVEINFO
Open
), 'user.php', _US_SURETODEL . '<br/>' . _US_REMOVEINFO);
- Exclude checks
Reference to undeclared constant \_US_YOUREMAIL
Open
'lang_youremail' => _US_YOUREMAIL,
- Exclude checks
Reference to undeclared constant \_US_RESETPASSWORD
Open
'lang_resetpassword' => _US_RESETPASSWORD,
- Exclude checks
Invalid offset "sitename"
of array type array{startpage:,template_set:mixed}
Open
$icmsMailer->setSubject(sprintf(_US_YOURACCOUNT, $icmsConfig['sitename'], ICMS_URL));
- Exclude checks
Reference to undeclared constant \_LOGIN
Open
'icms_pagetitle' => _LOGIN
- Exclude checks
Call to method handler
from undeclared class \icms
Open
$online_handler = icms::handler('icms_core_Online');
- Exclude checks
Reference to undeclared constant \_US_CURRENTPASS
Open
'lang_currentpass' => _US_CURRENTPASS,
- Exclude checks
Reference to undeclared constant \_US_ACTKEYNOT
Open
redirect_header('index.php', 5, _US_ACTKEYNOT);
- Exclude checks
Call to method setFromName
from undeclared class \icms_messaging_Handler
Open
$icmsMailer->setFromName($icmsConfig['sitename']);
- Exclude checks
Reference to undeclared constant \_US_ACTVMAILOK
Open
printf(_US_ACTVMAILOK, $thisuser->getVar('uname'));
- Exclude checks
Reference to undeclared constant \_US_ACTLOGIN
Open
redirect_header('user.php', 3, _US_ACTLOGIN, FALSE);
- Exclude checks
Call to method setToUsers
from undeclared class \icms_messaging_Handler
Open
$icmsMailer->setToUsers($thisuser);
- Exclude checks
Call to method setSubject
from undeclared class \icms_messaging_Handler
Open
$icmsMailer->setSubject(sprintf(_US_YOURACCOUNT, $icmsConfig['sitename'], ICMS_URL));
- Exclude checks
Reference to static property user
from undeclared class \icms
Open
if (!icms::$user) {
- Exclude checks
Argument 2 (variable_name)
is null
but \filter_input()
takes string
Open
'usercookie' => filter_input(INPUT_COOKIE, $icmsConfig['usercookie'], FILTER_SANITIZE_STRING),
- Exclude checks
Reference to static property user
from undeclared class \icms
Open
header('Location: ' . ICMS_URL . '/userinfo.php?uid=' . (int) icms::$user->getVar('uid'));
- Exclude checks
Reference to static property user
from undeclared class \icms
Open
$sessHandler->sessionClose(icms::$user->getVar('uid'));
- Exclude checks
Invalid offset "sitename"
of array type array{startpage:,template_set:mixed}
Open
$icmsMailer->assign('SITENAME', $icmsConfig['sitename']);
- Exclude checks
Reference to undeclared constant \_US_YOURACCOUNT
Open
$icmsMailer->setSubject(sprintf(_US_YOURACCOUNT, $icmsConfig['sitename'], ICMS_URL));
- Exclude checks
Reference to undeclared constant \_PASSWORD
Open
'lang_password' => _PASSWORD,
- Exclude checks
Reference to undeclared constant \_US_REMEMBERME
Open
'lang_rememberme' => _US_REMEMBERME,
- Exclude checks
Call to method setFromEmail
from undeclared class \icms_messaging_Handler
Open
$icmsMailer->setFromEmail($icmsConfig['adminmail']);
- Exclude checks
Reference to undeclared constant \_US_LOSTPASSWORD
Open
'lang_lostpassword' => _US_LOSTPASSWORD,
- Exclude checks
Reference to static property security
from undeclared class \icms
Open
'resetpassword_token' => icms::$security->createToken(),
- Exclude checks
Call to method assign
from undeclared class \icms_messaging_Handler
Open
$icmsMailer->assign('ADMINMAIL', $icmsConfig['adminmail']);
- Exclude checks
Reference to undeclared constant \_LOGIN
Open
'lang_login' => _LOGIN,
- Exclude checks
Reference to undeclared constant \_LOGIN
Open
'icms_pagetitle' => _LOGIN
- Exclude checks
Call to method __construct
from undeclared class \icms_messaging_Handler
Open
$icmsMailer = new icms_messaging_Handler();
- Exclude checks
Invalid offset "adminmail"
of array type array{startpage:,template_set:mixed}
Open
$icmsMailer->setFromEmail($icmsConfig['adminmail']);
- Exclude checks
Invalid offset "usercookie"
of array type array{startpage:,template_set:mixed}
Open
'usercookie' => filter_input(INPUT_COOKIE, $icmsConfig['usercookie'], FILTER_SANITIZE_STRING),
- Exclude checks
Reference to undeclared constant \_US_NEWPASSWORD
Open
'lang_newpass' => _US_NEWPASSWORD,
- Exclude checks
Call to method handler
from undeclared class \icms
Open
$member_handler = icms::handler('icms_member');
- Exclude checks
Invalid offset "adminmail"
of array type array{startpage:,template_set:mixed}
Open
$icmsMailer->assign('ADMINMAIL', $icmsConfig['adminmail']);
- Exclude checks
Call to method send
from undeclared class \icms_messaging_Handler
Open
if (!$icmsMailer->send()) {
- Exclude checks
Reference to undeclared constant \_US_NOTREGISTERED
Open
'lang_notregister' => _US_NOTREGISTERED,
- Exclude checks
Reference to static property user
from undeclared class \icms
Open
if (icms::$user) {
- Exclude checks
Reference to undeclared constant \_US_SENDPASSWORD
Open
'lang_sendpassword' => _US_SENDPASSWORD,
- Exclude checks
Reference to undeclared constant \_US_SUBRESETPASSWORD
Open
'lang_subresetpassword' => _US_SUBRESETPASSWORD,
- Exclude checks
Reference to static property session
from undeclared class \icms
Open
$sessHandler = icms::$session;
- Exclude checks
Argument 2 (vars)
is null
but \sprintf()
takes float|int|string
Open
$icmsMailer->setSubject(sprintf(_US_YOURACCOUNT, $icmsConfig['sitename'], ICMS_URL));
- Exclude checks
Reference to undeclared constant \_US_ACTVMAILNG
Open
printf(_US_ACTVMAILNG, $thisuser->getVar('uname'));
- Exclude checks
Reference to static property user
from undeclared class \icms
Open
$del_uid = (int) icms::$user->getVar('uid');
- Exclude checks
Call to method handler
from undeclared class \icms
Open
$member_handler = icms::handler('icms_member');
- Exclude checks
Reference to static property user
from undeclared class \icms
Open
if (FALSE != $member_handler->deleteUser(icms::$user)) {
- Exclude checks
Reference to undeclared constant \_US_NOPERMISS
Open
redirect_header('index.php', 5, _US_NOPERMISS);
- Exclude checks
Reference to undeclared constant \_US_THANKYOUFORVISIT
Open
redirect_header(ICMS_URL . '/', 3, _US_LOGGEDOUT . '<br />' . _US_THANKYOUFORVISIT);
- Exclude checks
Reference to undeclared constant \_US_BEENDELED
Open
redirect_header('index.php', 5, _US_BEENDELED);
- Exclude checks
Reference to undeclared constant \_USERNAME
Open
'lang_username' => _USERNAME,
- Exclude checks
Call to method assign
from undeclared class \icms_messaging_Handler
Open
$icmsMailer->assign('SITENAME', $icmsConfig['sitename']);
- Exclude checks
Reference to undeclared constant \_US_NOPROBLEM
Open
'lang_noproblem' => _US_NOPROBLEM,
- Exclude checks
Reference to undeclared constant \_US_SENDPASSWORD
Open
'lang_sendpassword' => _US_SENDPASSWORD,
- Exclude checks
Reference to undeclared constant \_US_VERIFYPASS
Open
'lang_newpass2' => _US_VERIFYPASS,
- Exclude checks
Call to method confirm
from undeclared class \icms_core_Message
Open
icms_core_Message::confirm(array (
- Exclude checks
Reference to undeclared constant \_US_ACONTACT
Open
redirect_header('user.php', 5, _US_ACONTACT, FALSE);
- Exclude checks
Call to method setTemplate
from undeclared class \icms_messaging_Handler
Open
$icmsMailer->setTemplate('activated.tpl');
- Exclude checks
Invalid offset "sitename"
of array type array{startpage:,template_set:mixed}
Open
$icmsMailer->setFromName($icmsConfig['sitename']);
- Exclude checks
Reference to undeclared constant \_US_NOPERMISS
Open
redirect_header('index.php', 5, _US_NOPERMISS);
- Exclude checks
Reference to undeclared constant \_US_SURETODEL
Open
), 'user.php', _US_SURETODEL . '<br/>' . _US_REMOVEINFO);
- Exclude checks
Reference to static property user
from undeclared class \icms
Open
header('Location: ' . ICMS_URL . '/userinfo.php?uid=' . (int) icms::$user->getVar('uid'));
- Exclude checks
Reference to static property user
from undeclared class \icms
Open
if (!icms::$user || $icmsConfigUser['self_delete'] != 1) {
- Exclude checks
Reference to static property user
from undeclared class \icms
Open
$groups = icms::$user->getGroups();
- Exclude checks
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 . '.') {
- 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 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
- 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 "false" but found "FALSE" Open
if (FALSE !== $member_handler->activateUser($thisuser)) {
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "false" but found "FALSE" Open
if ($pos !== FALSE) {
- Exclude checks
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;
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "false" but found "FALSE" Open
redirect_header('user.php', 3, _US_ACTLOGIN, FALSE);
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "false" but found "FALSE" Open
if (FALSE != $member_handler->deleteUser(icms::$user)) {
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "false" but found "FALSE" Open
$isExternal = FALSE;
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "false" but found "FALSE" Open
redirect_header('user.php', 5, _US_ACONTACT, FALSE);
- Exclude checks
Inline control structures are not allowed Open
if ($redirect && $redirect !== htmlspecialchars($_SERVER['REQUEST_URI'])) $redirect = ICMS_URL;
- Exclude checks