Showing 540 of 47,256 total issues
Function imanager_clone
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function imanager_clone() {
global $target, $type;
if (!icms::$security->check()) {
redirect_header('browser.php?op=list&target=' . $target . '&type=' . $type, 3, implode('<br />', icms::$security->getErrors()));
- 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
Function b_system_newmembers_show
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function b_system_newmembers_show($options) {
global $icmsConfigUser;
$block = array();
$criteria = new icms_db_criteria_Compo(new icms_db_criteria_Item('level', 0, '>'));
- 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
Function imanager_clone
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function imanager_clone() {
if (!icms::$security->check()) {
redirect_header('admin.php?fct=images', 3, implode('<br />', icms::$security->getErrors()));
}
- 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
Function b_system_notification_show
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function b_system_notification_show() {
icms_loadLanguageFile('core', 'notification');
// Notification must be enabled, and user must be logged in
if (empty(icms::$user) || !icms_data_notification_Handler::isEnabled('block')) {
return false; // do not display block
- 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
Method xoopsCodeTarea
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xoopsCodeTarea($textarea_id, $cols=60, $rows=15, $suffix=null)
{
icms_core_Debug::setDeprecated('icms_form_elements_Dhtmltextarea.', sprintf(_CORE_REMOVE_IN_VERSION, '2.0'));
$hiddentext = isset($suffix) ? 'xoopsHiddenText'.trim($suffix) : 'xoopsHiddenText';
//Hack for url, email ...., the anchor is for having a link on [_More...]
Method b_system_main_show
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function b_system_main_show() {
global $icmsConfigUser;
$block = array();
$block['lang_home'] = _MB_SYSTEM_HOME;
Method b_system_topposters_show
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function b_system_topposters_show($options) {
global $icmsConfigUser;
$block = array();
$criteria = new icms_db_criteria_Compo(new icms_db_criteria_Item('level', 0, '>'));
Function request
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
request: function(url) {
this.url = url;
this.method = this.options.method;
var params = Object.isString(this.options.parameters) ?
this.options.parameters :
Method load_invite_code
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function load_invite_code($code) {
// validate if code is of valid length.
if (empty($code) || strlen($code) != 8) {
header('Location: invite.php');
// redirect_header('invite.php', 0, _US_INVITENONE);
Method apply_config
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function apply_config()
{
$db = $GLOBALS['xoopsDB'];
// remove configuration items
$db->queryF("DELETE FROM `" . $db->prefix('config') . "` WHERE conf_name='cpanel'");
Function Selector
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Prototype.Selector = (function() {
function select() {
throw new Error('Method "Prototype.Selector.select" must be defined.');
}
Function TCGenerateMac
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function TCGenerateMac() {
var s = '';
var c = 0,n = 1;
var r,g,b;
for (j = 0; j < 15; j ++) {
Method xoFormFieldCollation
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xoFormFieldCollation($name, $value, $label, $link, $charset, $help = '') {
if (version_compare(getDBVersion($link), "4.1.0", "lt")) {
return "";
}
if (empty ($charset) || !$collations = getDbCollations($link, $charset)) {
Method checkSql
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function checkSql($sql) {
list($sql_wo_strings, $strings) = $this->separateStringsInSQL($sql);
// stage1: addslashes() processed or not
foreach ($this->doubtful_requests as $request) {
Method deny_by_htaccess
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function deny_by_htaccess($ip = null) {
if (empty($ip)) $ip = filter_input(INPUT_SERVER, 'REMOTE_ADDR', FILTER_VALIDATE_IP);
if (empty($ip)) return false;
if (!function_exists('file_get_contents')) return false;
Method draw_repost_form
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function draw_repost_form($area = '') {
// Notify which file is broken
if (headers_sent()) {
restore_error_handler();
set_error_handler(array (
Method imCheckRequirements
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function imCheckRequirements()
{
$requirement['server_api']['description']=PHP_SAPI;
$requirement['server_api']['result']=php_sapi_name();
$requirement['server_api']['status']=true;
Method imanager_delfileok
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function imanager_delfileok($image_id, $redir = NULL) {
global $target, $type;
if (!icms::$security->check()) {
redirect_header('browser.php?op=list&target=' . $target . '&type=' . $type, 3, implode('<br />', icms::$security->getErrors()));
}
Method icmsPopupHeader
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function icmsPopupHeader() {
//TODO: make the image manager header use a template instead of hardcoded HTML
global $icmsConfig;
if (!headers_sent()) {
header('Content-Type:text/html; charset=' . _CHARSET);
Function icms_escapeValue
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function icms_escapeValue($value, $quotes = true)
{
if(is_string($value))
{
$value = icms::$xoopsDB->escape($value);
- 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"