ImpressCMS/impresscms

View on GitHub

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()));
Severity: Minor
Found in htdocs/modules/system/admin/images/browser.php - About 1 hr to fix

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, '>'));
Severity: Minor
Found in htdocs/modules/system/blocks/system_blocks.php - About 1 hr to fix

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()));
    }

Severity: Minor
Found in htdocs/modules/system/admin/images/main.php - About 1 hr to fix

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
Severity: Minor
Found in htdocs/modules/system/blocks/system_blocks.php - About 1 hr to fix

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...]
Severity: Minor
Found in htdocs/include/xoopscodes.php - About 1 hr to fix

    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;
    Severity: Minor
    Found in htdocs/modules/system/blocks/system_blocks.php - About 1 hr to fix

      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, '>'));
      Severity: Minor
      Found in htdocs/modules/system/blocks/system_blocks.php - About 1 hr to fix

        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 :
        Severity: Minor
        Found in htdocs/install/prototype.js - About 1 hr to fix

          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);
          Severity: Minor
          Found in htdocs/include/checkinvite.php - About 1 hr to fix

            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'");
            Severity: Minor
            Found in upgrade/cnt-2.3.x-to-2.0.x/index.php - About 1 hr to fix

              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.');
                  }
              Severity: Minor
              Found in htdocs/install/prototype.js - About 1 hr to fix

                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 ++) {
                Severity: Minor
                Found in htdocs/include/color-picker.js - About 1 hr to fix

                  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)) {
                  Severity: Minor
                  Found in htdocs/install/page_dbsettings.php - About 1 hr to fix

                    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;
                          Severity: Minor
                          Found in htdocs/install/page_modcheck.php - About 1 hr to fix

                            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()));
                                }
                            Severity: Minor
                            Found in htdocs/modules/system/admin/images/browser.php - About 1 hr to fix

                              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);
                              Severity: Minor
                              Found in htdocs/modules/system/admin/images/browser.php - About 1 hr to fix

                                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);
                                Severity: Minor
                                Found in htdocs/include/functions.php - About 1 hr to fix

                                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

                                Severity
                                Category
                                Status
                                Source
                                Language