Showing 47,251 of 47,256 total issues
Avoid deeply nested control flow statements. Open
if (!$purifier_style_updated
&& $config->getVar('conf_catid') == ICMS_CONF_PURIFIER
&& $config->getVar('conf_name') == 'purifier_Filter_ExtractStyleBlocks'
) {
if ($config->getVar('purifier_Filter_ExtractStyleBlocks') == 1) {
Avoid deeply nested control flow statements. Open
for ($j = 0; $j < $btcount; $j++ ) {
if (!$tplfile_handler->delete($templates[$j])) {
$msgs[] = sprintf(' <span style="color:#ff0000;">' . _MD_AM_BLOCK_TMPLT_DELETE_FAILED . '</span>', $templates[$j]->getVar('tpl_file'), '<strong>' . icms_conv_nr2local($templates[$j]->getVar('tpl_id')) . '</strong>');
} else {
$msgs[] = sprintf(' ' . _MD_AM_BLOCK_TMPLT_DELETED, '<strong>' . $templates[$j]->getVar('tpl_file') . '</strong>', '<strong>' . icms_conv_nr2local($templates[$j]->getVar('tpl_id')) . '</strong>');
Avoid deeply nested control flow statements. Open
if ($template != '') {
$tplfile = &$tplfile_handler->create();
$tplfile->setVar('tpl_module', $dirname);
$tplfile->setVar('tpl_refid', (int) $newbid);
$tplfile->setVar('tpl_source', $content, TRUE);
Avoid deeply nested control flow statements. Open
if (! $startmod_updated && $new_value != '--' && $config->getVar('conf_catid') == ICMS_CONF && $config->getVar('conf_name') == 'startpage') {
$moduleperm_handler = icms::handler('icms_member_groupperm');
$module_handler = icms::handler('icms_module');
foreach ($new_value as $k => $v) {
Function checkData
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function checkData() {
$ret = '';
$error = array();
if (empty($this->dbhost)) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid deeply nested control flow statements. Open
if (0 === strpos($oldavatar_path, ICMS_UPLOAD_PATH) && is_file($oldavatar_path)) {
unlink($oldavatar_path);
}
Avoid deeply nested control flow statements. Open
if (!empty($oldavatar) && preg_match("/^cavt/", strtolower($oldavatar))) {
$avatars =& $avt_handler->getObjects(new icms_db_criteria_Item('avatar_file', $oldavatar));
if (!empty($avatars) && count($avatars) == 1 && is_object($avatars[0])) {
$avt_handler->delete($avatars[0]);
$oldavatar_path = str_replace("\\", "/", realpath(ICMS_UPLOAD_PATH . '/' . $oldavatar));
Avoid deeply nested control flow statements. Open
if ($counter == $totalpages && $currentpage < $totalpages - 4) {
$hiddenform .= "... ";
}
Function __construct
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function __construct() {
global $icmsConfig;
// language file
if (defined('ICMS_ROOT_PATH') && !empty($icmsConfig['language']) && !strstr($icmsConfig['language'], '/')) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid deeply nested control flow statements. Open
if (empty($newbid)) {
$newbid = icms::$xoopsDB->getInsertId();
}
Function insert
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function insert($table, $query) {
$this->db->connect();
$table = $this->db->prefix($table);
$query = 'INSERT INTO '.$table.' '.$query;
if (!$this->db->queryF($query)) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid deeply nested control flow statements. Open
if (! $tpl_updated && $config->getVar('conf_catid') == ICMS_CONF && $config->getVar('conf_name') == 'template_set') {
// clear cached/compiled files and regenerate them if default theme has been changed
if ($icmsConfig['template_set'] != ${$config->getVar('conf_name')}) {
$newtplset = ${$config->getVar('conf_name')};
// clear all compiled and cachedfiles
Method getForm
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getForm($form_caption, $form_name, $form_action = FALSE, $submit_button_caption = _CO_ICMS_SUBMIT, $cancel_js_action = FALSE, $captcha = FALSE) {
Function SmilesEdit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function SmilesEdit($id) {
$db = &icms_db_Factory::instance();
icms_cp_header();
echo '<a href="admin.php?fct=smilies">' . _AM_SMILESCONTROL . '</a> <span style="font-weight:bold;">»»</span> ' . _AM_EDITSMILE . '<br /><br />';
if ($getsmiles = $db->query("SELECT * FROM " . $db->prefix("smiles") . " WHERE id = '" . (int) $id . "'")) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid deeply nested control flow statements. Open
if (file_exists($lookup_file)) {
include_once $lookup_file;
if (!empty($not_config['lookup_func']) && function_exists($not_config['lookup_func'])) {
$lookup_func = $not_config['lookup_func'];
}
Avoid deeply nested control flow statements. Open
if (!@unlink($src)) {
$error[] = sprintf(_MD_FAILUNLINK, $i);
}
Function b_system_topposters_edit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function b_system_topposters_edit($options) {
$inputtag = "<input type='text' name='options[]' value='" . (int) $options[0] . "' />";
$form = sprintf(_MB_SYSTEM_DISPLAY, $inputtag);
$form .= "<br />" . _MB_SYSTEM_DISPLAYA . " <input type='radio' id='options[]' name='options[]' value='1'";
if ($options[1] == 1) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid deeply nested control flow statements. Open
if (!copy($src, $dest)) {
$error[] = sprintf(_FAILSAVEIMG, $image_id[$i]);
}
Avoid deeply nested control flow statements. Open
if (!empty($results[$i]['uid'])) {
$uname = icms_member_user_Object::getUnameFromId($results[$i]['uid']);
$results[$i]['processed_user_name'] = $uname;
$results[$i]['processed_user_url'] = ICMS_URL . "/userinfo.php?uid=" . $results[$i]['uid'];
}
Avoid deeply nested control flow statements. Open
if ($files[$i]->getVar('tpl_type') == 'block') {
$path = $tplset . '/templates/' . $files[$i]->getVar('tpl_module') . '/blocks/' . $files[$i]->getVar('tpl_file');
$xml .= "\r\n <template name=\"" . $files[$i]->getVar('tpl_file') . "\">\r\n <module>" . $files[$i]->getVar('tpl_module') . "</module>\r\n <type>block</type>\r\n <lastModified>" . $files[$i]->getVar('tpl_lastmodified') . "</lastModified>\r\n </template>";
} elseif ($files[$i]->getVar('tpl_type') == 'module') {
$path = $tplset . '/templates/' . $files[$i]->getVar('tpl_module') . '/' . $files[$i]->getVar('tpl_file');