Avoid deeply nested control flow statements. Open
if (!preg_match("/^http[s]*:\/\//i", $results[$i]['link'])) {
$results[$i]['link'] = "modules/" . $module->getVar('dirname') . "/" . $results[$i]['link'];
}
Reference to static property user
from undeclared class \icms
Open
$groups = is_object(icms::$user) ? icms::$user->getGroups() : XOOPS_GROUP_ANONYMOUS;
- Exclude checks
Reference to undeclared constant \_US_MSNM
Open
'lang_msnm' => _US_MSNM,
- Exclude checks
Call to method checkVar
from undeclared class \icms_core_DataFilter
Open
'user_extrainfo' => icms_core_DataFilter::checkVar($thisUser->getVar('bio', 'N'), 'text', 'output'),
- Exclude checks
Reference to undeclared constant \_US_MOREABOUT
Open
'lang_more' => _US_MOREABOUT,
- Exclude checks
Reference to static property user
from undeclared class \icms
Open
|| (is_object(icms::$user)
- Exclude checks
Call to method checkVar
from undeclared class \icms_core_DataFilter
Open
'user_signature' => icms_core_DataFilter::checkVar($thisUser->getVar('user_sig', 'N'), $sigtype, 'output')
- Exclude checks
Invalid offset "time"
of array type array{image:string}|array{link:string}|array{title:}|null
Open
$results[$i]['time'] = $results[$i]['time'] ? formatTimestamp($results[$i]['time']) : '';
- Exclude checks
Variable $icmsConfigUser
is undeclared Open
'user_candelete' => $icmsConfigUser['self_delete'] ? true : false,
- Exclude checks
Variable $icmsTpl
is undeclared Open
$icmsTpl->assign('user_ownpage', false);
- Exclude checks
Reference to undeclared constant \_US_ALLABOUT
Open
'lang_allaboutuser' => sprintf(_US_ALLABOUT, $thisUser->getVar('uname')),
- Exclude checks
Reference to undeclared constant \_NOPERM
Open
redirect_header(ICMS_URL . '/user.php', 3, _NOPERM);
- Exclude checks
Reference to static property user
from undeclared class \icms
Open
if (is_object(icms::$user)) {
- Exclude checks
Call to method handler
from undeclared class \icms
Open
$thisUser = icms::handler('icms_member')->getUser($uid);
- Exclude checks
Variable $icmsConfigUser
is undeclared Open
if ($icmsConfigUser['allwshow_sig'] == true && strlen(trim($thisUser->getVar('user_sig', 'N'))) > 0) {
- Exclude checks
Call to method __construct
from undeclared class \icms_db_criteria_Item
Open
$criteria->add(new icms_db_criteria_Item('isactive', 1));
- 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
$results[$i]['link'] = "modules/" . $module->getVar('dirname') . "/" . $results[$i]['link'];
- Exclude checks
Reference to undeclared constant \_US_SELECTNG
Open
redirect_header('index.php', 3, _US_SELECTNG);
- Exclude checks
Reference to undeclared constant \_US_EDITPROFILE
Open
'lang_editprofile' => _US_EDITPROFILE,
- Exclude checks
Reference to undeclared constant \_US_PM
Open
'lang_privmsg' => _US_PM,
- Exclude checks
Reference to undeclared constant \_US_YIM
Open
'lang_yim' => _US_YIM,
- Exclude checks
Variable $icmsTpl
is undeclared Open
$icmsTpl->append('modules', array('name' => $module->getVar('name'),
- Exclude checks
Variable $icmsTpl
is undeclared Open
$icmsTpl->assign('user_ownpage', false);
- Exclude checks
Reference to undeclared constant \_US_REALNAME
Open
'lang_realname' => _US_REALNAME,
- Exclude checks
Variable $icmsConfig
is undeclared Open
. ICMS_URL . "/images/icons/" . $icmsConfig['language'] . "/pm.gif\" alt=\""
- Exclude checks
Argument 2 (subject)
is null
but \preg_match()
takes string
Open
if (!preg_match("/^http[s]*:\/\//i", $results[$i]['link'])) {
- Exclude checks
Reference to undeclared constant \_US_EDITPROFILE
Open
'lang_editprofile' => _US_EDITPROFILE,
- Exclude checks
Reference to undeclared constant \_US_SELECTNG
Open
redirect_header('index.php', 3, _US_SELECTNG);
- Exclude checks
Reference to undeclared constant \_US_WEBSITE
Open
'lang_website' => _US_WEBSITE,
- Exclude checks
Reference to undeclared constant \_US_AVATAR
Open
'lang_avatar' => _US_AVATAR,
- Exclude checks
Reference to undeclared constant \_US_EXTRAINFO
Open
'lang_extrainfo' => _US_EXTRAINFO,
- Exclude checks
Reference to static property user
from undeclared class \icms
Open
'user_pmlink' => is_object(icms::$user)
- Exclude checks
Variable $icmsConfig
is undeclared Open
$results[$i]['image'] = 'images/icons/' . $icmsConfig['language'] . '/posticon2.gif';
- Exclude checks
Invalid offset "title"
of array type array{image:string}|array{link:string}|null
Open
$results[$i]['title'] = icms_core_DataFilter::htmlSpecialChars($results[$i]['title']);
- Exclude checks
Variable $icmsTpl
is undeclared Open
$icmsTpl->assign('user_ownpage', true);
- Exclude checks
Reference to static property user
from undeclared class \icms
Open
if (is_object(icms::$user) && $isAdmin) {
- Exclude checks
Reference to undeclared constant \_US_AIM
Open
'lang_aim' => _US_AIM,
- Exclude checks
Reference to undeclared constant \_US_OCCUPATION
Open
'lang_occupation' => _US_OCCUPATION,
- Exclude checks
Reference to undeclared constant \_US_RANK
Open
'lang_rank' => _US_RANK,
- Exclude checks
Reference to undeclared constant \_US_MYINFO
Open
'lang_myinfo' => _US_MYINFO,
- Exclude checks
Reference to static property user
from undeclared class \icms
Open
&& (icms::$user->isAdmin()
- Exclude checks
Variable $icmsConfigUser
is undeclared Open
$sigtype = ($icmsConfigUser['allow_htsig'] == 0) ? 'text' : 'html';
- Exclude checks
Reference to undeclared constant \_US_NOTIFICATIONS
Open
'lang_notifications' => _US_NOTIFICATIONS,
- Exclude checks
Variable $icmsConfigUser
is undeclared Open
'lang_deleteaccount' => $icmsConfigUser['self_delete'] ? _US_DELACCOUNT : ''));
- Exclude checks
Reference to undeclared constant \_US_SIGNATURE
Open
'lang_signature' => _US_SIGNATURE,
- Exclude checks
Invalid offset "link"
of array type array{image:string}
Open
if (!preg_match("/^http[s]*:\/\//i", $results[$i]['link'])) {
- Exclude checks
Reference to undeclared constant \_US_EMAIL
Open
'lang_email' => _US_EMAIL,
- Exclude checks
Reference to undeclared constant \_US_LASTLOGIN
Open
'lang_lastlogin' => _US_LASTLOGIN,
- Exclude checks
Call to method add
from undeclared class \icms_db_criteria_Compo
Open
$criteria->add(new icms_db_criteria_Item('isactive', 1));
- Exclude checks
Reference to undeclared constant \_US_SELECTNG
Open
redirect_header('index.php', 3, _US_SELECTNG);
- Exclude checks
Reference to undeclared constant \_US_AVATAR
Open
'lang_avatar' => _US_AVATAR,
- Exclude checks
Reference to undeclared constant \_US_DELACCOUNT
Open
'lang_deleteaccount' => $icmsConfigUser['self_delete'] ? _US_DELACCOUNT : ''));
- Exclude checks
Reference to undeclared constant \_US_BASICINFO
Open
'lang_basicInfo' => _US_BASICINFO,
- Exclude checks
Call to method __construct
from undeclared class \icms_db_criteria_Compo
Open
$criteria = new icms_db_criteria_Compo(new icms_db_criteria_Item('hassearch', 1));
- Exclude checks
Call to method __construct
from undeclared class \icms_db_criteria_Item
Open
$criteria = new icms_db_criteria_Compo(new icms_db_criteria_Item('hassearch', 1));
- Exclude checks
Invalid offset "link"
of array type array{image:string}
Open
$results[$i]['link'] = "modules/" . $module->getVar('dirname') . "/" . $results[$i]['link'];
- Exclude checks
Call to method handler
from undeclared class \icms
Open
$gperm_handler = icms::handler('icms_member_groupperm');
- Exclude checks
Call to method handler
from undeclared class \icms
Open
$thisUser = icms::handler('icms_member')->getUser($uid);
- Exclude checks
Reference to undeclared constant \_SENDPMTO
Open
. sprintf(_SENDPMTO, $thisUser->getVar('uname')) . "\" /></a>"
- Exclude checks
Argument 1 (time)
is null
but \formatTimestamp()
takes string
defined at /code/htdocs/include/functions.php:1428
Open
$results[$i]['time'] = $results[$i]['time'] ? formatTimestamp($results[$i]['time']) : '';
- Exclude checks
Variable $icmsConfigUser
is undeclared Open
if (!$icmsConfigUser['allow_annon_view_prof'] && !is_object(icms::$user)) {
- Exclude checks
Reference to undeclared constant \_US_LOGOUT
Open
'lang_logout' => _US_LOGOUT,
- Exclude checks
Reference to static property user
from undeclared class \icms
Open
|| (icms::$user->getVar('uid') == $thisUser->getVar('uid')))))
- Exclude checks
Call to method handler
from undeclared class \icms
Open
$module_handler = icms::handler('icms_module');
- Exclude checks
Reference to undeclared constant \_US_LOCATION
Open
'lang_location' => _US_LOCATION,
- Exclude checks
Reference to undeclared constant \_US_SHOWALL
Open
'&uid='. (int) $thisUser->getVar('uid') . '">' . _US_SHOWALL . '</a>';
- Exclude checks
Call to method handler
from undeclared class \icms
Open
$module = icms::handler("icms_module")->getByDirName("profile", true);
- Exclude checks
Reference to undeclared constant \_US_DELACCOUNT
Open
'lang_deleteaccount' => _US_DELACCOUNT,
- Exclude checks
Reference to undeclared constant \_US_ICQ
Open
'lang_icq' => _US_ICQ,
- Exclude checks
Reference to undeclared constant \_US_STATISTICS
Open
'lang_statistics' => _US_STATISTICS,
- Exclude checks
Reference to static property user
from undeclared class \icms
Open
$thisUser = icms::$user;
- Exclude checks
Variable $icmsConfigUser
is undeclared Open
'user_avatarurl' => $icmsConfigUser['avatar_allow_gravatar'] == true
- Exclude checks
Reference to undeclared constant \_US_MEMBERSINCE
Open
'lang_membersince' => _US_MEMBERSINCE,
- Exclude checks
Reference to undeclared constant \_US_INTEREST
Open
'lang_interest' => _US_INTEREST,
- Exclude checks
Reference to undeclared constant \_US_POSTS
Open
'lang_posts' => _US_POSTS,
- Exclude checks
Invalid offset "link"
of array type array{image:string}
Open
if (isset($results[$i]['link']) && $results[$i]['link'] != '') {
- Exclude checks
Reference to undeclared constant \_US_NOTREGISTERED
Open
'lang_notregistered' => _US_NOTREGISTERED,
- Exclude checks
Reference to undeclared constant \_US_ALLABOUT
Open
'icms_pagetitle' => sprintf(_US_ALLABOUT, $thisUser->getVar('uname')),
- Exclude checks
Reference to static property user
from undeclared class \icms
Open
if (!$icmsConfigUser['allow_annon_view_prof'] && !is_object(icms::$user)) {
- Exclude checks
Reference to static property user
from undeclared class \icms
Open
if ($uid == icms::$user->getVar('uid')) {
- Exclude checks
Reference to undeclared constant \_US_INBOX
Open
'lang_inbox' => _US_INBOX,
- Exclude checks
Call to method htmlSpecialChars
from undeclared class \icms_core_DataFilter
Open
$results[$i]['title'] = icms_core_DataFilter::htmlSpecialChars($results[$i]['title']);
- Exclude checks
Identical blocks of code found in 2 locations. Consider refactoring. Open
if ($uid == icms::$user->getVar('uid')) {
$xoopsOption['template_main'] = 'system_userinfo.html';
include ICMS_ROOT_PATH . '/header.php';
$icmsTpl->assign('user_ownpage', true);
icms_makeSmarty(array(
- 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 103.
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 (is_object(icms::$user)) {
if ($uid == icms::$user->getVar('uid')) {
$xoopsOption['template_main'] = 'system_userinfo.html';
include ICMS_ROOT_PATH . '/header.php';
$icmsTpl->assign('user_ownpage', true);
- 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 103.
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
Tabs must be used to indent lines; spaces are not allowed Open
'lang_editprofile' => _US_EDITPROFILE,
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$results[$i]['link'] = "modules/" . $module->getVar('dirname') . "/" . $results[$i]['link'];
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
}
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
'lang_inbox' => _US_INBOX,
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
unset ($module);
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
'user_uid' => (int) $thisUser->getVar('uid')
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
if ($gperm_handler->checkRight('module_read', $mid, $groups)) {
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
for ($i = 0; $i < $count; $i++) {
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
if (!preg_match("/^http[s]*:\/\//i", $results[$i]['link'])) {
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
} else {
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$icmsTpl->append('modules', array('name' => $module->getVar('name'),
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$module = $module_handler->get($mid);
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
'lang_avatar' => _US_AVATAR,
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
'lang_logout' => _US_LOGOUT,
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
'lang_deleteaccount' => $icmsConfigUser['self_delete'] ? _US_DELACCOUNT : ''));
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$results = $module->search('', '', 5, 0, (int) $thisUser->getVar('uid'));
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
}
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$results[$i]['time'] = $results[$i]['time'] ? formatTimestamp($results[$i]['time']) : '';
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$showall_link = '<a href="search.php?action=showallbyuser&mid='. (int) $mid.
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
}
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
if (is_array($results) && $count > 0) {
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
}
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$showall_link = '';
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
if (isset($results[$i]['link']) && $results[$i]['link'] != '') {
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
'lang_notifications' => _US_NOTIFICATIONS,
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
'user_candelete' => $icmsConfigUser['self_delete'] ? true : false,
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$count = count($results);
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
'user_ownpage' => true,
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
'lang_editprofile' => _US_EDITPROFILE,
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
'lang_deleteaccount' => _US_DELACCOUNT,
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
if (isset($results[$i]['image']) && $results[$i]['image'] != '') {
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
}
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$results[$i]['image'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['image'];
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$results[$i]['image'] = 'images/icons/' . $icmsConfig['language'] . '/posticon2.gif';
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
}
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$results[$i]['title'] = icms_core_DataFilter::htmlSpecialChars($results[$i]['title']);
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
if ($count == 5) {
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
} else {
- Exclude checks
Expected 1 space after closing brace; newline found Open
}
- Exclude checks
Space before opening parenthesis of function call prohibited Open
unset ($module);
- Exclude checks
Unexpected spaces found. Open
'lang_editprofile' => _US_EDITPROFILE,
- Exclude checks
Unexpected spaces found. Open
if (isset($results[$i]['image']) && $results[$i]['image'] != '') {
- Exclude checks
Unexpected spaces found. Open
'user_ownpage' => true,
- Exclude checks
Unexpected spaces found. Open
$showall_link = '<a href="search.php?action=showallbyuser&mid='. (int) $mid.
- Exclude checks
Unexpected spaces found. Open
$results[$i]['image'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['image'];
- Exclude checks
Unexpected spaces found. Open
}
- Exclude checks
Unexpected spaces found. Open
}
- Exclude checks
Unexpected spaces found. Open
'lang_notifications' => _US_NOTIFICATIONS,
- Exclude checks
Unexpected spaces found. Open
$icmsTpl->append('modules', array('name' => $module->getVar('name'),
- Exclude checks
Unexpected spaces found. Open
for ($i = 0; $i < $count; $i++) {
- Exclude checks
Unexpected spaces found. Open
$results[$i]['time'] = $results[$i]['time'] ? formatTimestamp($results[$i]['time']) : '';
- Exclude checks
Unexpected spaces found. Open
'lang_deleteaccount' => _US_DELACCOUNT,
- Exclude checks
Unexpected spaces found. Open
if ($gperm_handler->checkRight('module_read', $mid, $groups)) {
- Exclude checks
Unexpected spaces found. Open
if (is_array($results) && $count > 0) {
- Exclude checks
Unexpected spaces found. Open
} else {
- Exclude checks
Unexpected spaces found. Open
} else {
- Exclude checks
Unexpected spaces found. Open
if (isset($results[$i]['link']) && $results[$i]['link'] != '') {
- Exclude checks
Unexpected spaces found. Open
}
- Exclude checks
Unexpected spaces found. Open
'lang_avatar' => _US_AVATAR,
- Exclude checks
Unexpected spaces found. Open
'lang_deleteaccount' => $icmsConfigUser['self_delete'] ? _US_DELACCOUNT : ''));
- Exclude checks
Unexpected spaces found. Open
'user_uid' => (int) $thisUser->getVar('uid')
- Exclude checks
Unexpected spaces found. Open
$showall_link = '';
- Exclude checks
Unexpected spaces found. Open
$results = $module->search('', '', 5, 0, (int) $thisUser->getVar('uid'));
- Exclude checks
Unexpected spaces found. Open
}
- Exclude checks
Unexpected spaces found. Open
$results[$i]['title'] = icms_core_DataFilter::htmlSpecialChars($results[$i]['title']);
- Exclude checks
Unexpected spaces found. Open
$results[$i]['link'] = "modules/" . $module->getVar('dirname') . "/" . $results[$i]['link'];
- Exclude checks
Unexpected spaces found. Open
if ($count == 5) {
- Exclude checks
Unexpected spaces found. Open
'lang_editprofile' => _US_EDITPROFILE,
- Exclude checks
Unexpected spaces found. Open
$results[$i]['image'] = 'images/icons/' . $icmsConfig['language'] . '/posticon2.gif';
- Exclude checks
Unexpected spaces found. Open
'lang_inbox' => _US_INBOX,
- Exclude checks
Unexpected spaces found. Open
'lang_logout' => _US_LOGOUT,
- Exclude checks
Unexpected spaces found. Open
'user_candelete' => $icmsConfigUser['self_delete'] ? true : false,
- Exclude checks
Unexpected spaces found. Open
$module = $module_handler->get($mid);
- Exclude checks
Unexpected spaces found. Open
$count = count($results);
- Exclude checks
Unexpected spaces found. Open
if (!preg_match("/^http[s]*:\/\//i", $results[$i]['link'])) {
- Exclude checks
Unexpected spaces found. Open
}
- Exclude checks
Unexpected spaces found. Open
}
- Exclude checks
Unexpected spaces found. Open
unset ($module);
- Exclude checks