ImpressCMS/impresscms

View on GitHub

Showing 47,251 of 47,256 total issues

Avoid deeply nested control flow statements.
Open

nodes[i].id = id + "-" + (tree.length - 1) + "-section"; var box1 = document.getElementById(id + "-" + (tree.length - 1)); var box2 = document.getElementById(nodes[i].id); var el = new Element(box1.id); if (el.level == 1) { if (this.type == "horizontal") { box2.style.top = (box1.offsetTop + box1.offsetHeight + this.position.level1.top) + "px"; if (this.browser.ie5) { box2.style.left = (this.position.level1.left) + "px";} else {
/* Start open menu from right_to_left - added by stranger @ www.impresscms.ir , Script & Original hack are made by irmtfan (www.jadoogaran.org) */
box2.style.Right = ( box1.offsetLeft + this.position.level1.left) + "px";}
Severity: Major
Found in htdocs/include/icms_rtl.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if ( elem && elem.parentNode ) {
                                if ( elem.id === m ) {
                                    results.push( elem );
                                    return results;
                                }
    Severity: Major
    Found in htdocs/install/prototype.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if ( Expr.relative[ tokens[j].type ] ) {
                                  break;
                              }
      Severity: Major
      Found in htdocs/install/prototype.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
                                    contains( context, elem ) && elem.id === m ) {
                                    results.push( elem );
                                    return results;
                                }
        Severity: Major
        Found in htdocs/install/prototype.js - About 45 mins to fix

          Function $ has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              function $() {
                  var elements = new Array();
          
                  for (var i = 0; i < arguments.length; i++) {
                      var element = arguments[i];
          Severity: Minor
          Found in htdocs/include/xoops.js - About 45 mins 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

          Avoid deeply nested control flow statements.
          Open

                                          if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
                                              return true;
                                          }
          Severity: Major
          Found in htdocs/install/prototype.js - About 45 mins to fix

            Function addItem has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            function addItem(itemurl, name, target, cat, url, type) {
            Severity: Minor
            Found in htdocs/modules/system/admin/images/js/imanager.js - About 45 mins to fix

              Function isApplied has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function isApplied() {
                      if (!isset($_SESSION[__CLASS__]) || !is_array($_SESSION[__CLASS__])) {
                          $_SESSION[__CLASS__] = array();
                      }
                      foreach ($this->tasks as $task) {
              Severity: Minor
              Found in upgrade/upd-icms-1.0-to-1.1/index.php - About 45 mins 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 isApplied has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  function isApplied()
                  {
                      if (!isset($_SESSION[__CLASS__]) || !is_array($_SESSION[__CLASS__])) {
                          $_SESSION[__CLASS__] = array();
                      }
              Severity: Minor
              Found in upgrade/cnt-2.3.x-to-2.0.x/index.php - About 45 mins 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

              Avoid deeply nested control flow statements.
              Open

                                          if ($template != '') {
                                              $tplfile =& $tplfile_handler->find('default', 'block', $fblock['bid']);
                                              if (count($tplfile) == 0) {
                                                  $tplfile_new =& $tplfile_handler->create();
                                                  $tplfile_new->setVar('tpl_module', $dirname);
              Severity: Major
              Found in htdocs/install/modulesadmin.php - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if (false != $comments) {
                                            $renderer =& icms_data_comment_Renderer::instance($xoopsTpl);
                                            $renderer->setComments($comments);
                                            $renderer->renderThreadView($top_comments[$i]->getVar('com_id'), $admin_view);
                                        }
                Severity: Major
                Found in htdocs/include/comment_view.php - About 45 mins to fix

                  Method xoFormFieldCollation has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  function xoFormFieldCollation($name, $value, $label, $link, $charset, $help = '') {
                  Severity: Minor
                  Found in htdocs/install/page_dbsettings.php - About 45 mins to fix

                    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'];
                                           }
                    Severity: Major
                    Found in htdocs/userinfo.php - About 45 mins to fix

                      Function icms_get_base_domain has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function icms_get_base_domain($url)
                      {
                          $debug = 0;
                          $base_domain = '';
                      
                      
                      Severity: Minor
                      Found in htdocs/include/functions.php - About 45 mins 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 icms_getModuleName has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function icms_getModuleName($withLink = true, $forBreadCrumb = false, $moduleName = false) {
                          if (!$moduleName) {
                              $moduleName = icms::$module->getVar('dirname');
                          }
                          //$icmsModule = icms_getModuleInfo($moduleName);
                      Severity: Minor
                      Found in htdocs/include/functions.php - About 45 mins 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

                      Avoid deeply nested control flow statements.
                      Open

                                          if($poster_id != 0) {$deleted_num[$poster_id] = !isset($deleted_num[$poster_id]) ? 1 : ($deleted_num[$poster_id] + 1);}
                      Severity: Major
                      Found in htdocs/include/functions.php - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                        while ($row = fetch_assoc($result)) {
                                            $character_sets[$row["Variable_name"]] = $row["Value"];
                                        }
                        Severity: Major
                        Found in htdocs/install/page_dbsettings.php - About 45 mins to fix

                          Function xoopsCodeTarea has a Cognitive Complexity of 8 (exceeds 5 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 45 mins 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 xoFormBlockCollation has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          function xoFormBlockCollation($name, $value, $label, $link, $charset, $help = '') {
                          Severity: Minor
                          Found in htdocs/install/page_dbsettings.php - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                        if (empty($newbid)) {
                                                            $newbid = $db->getInsertId();
                                                        }
                            Severity: Major
                            Found in htdocs/install/modulesadmin.php - About 45 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language