ImpressCMS/impresscms

View on GitHub

Showing 540 of 47,256 total issues

Function xoopsCodeCode has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

function xoopsCodeCode(id, enterCodePhrase, enterCodeLangPhrase, CodeLangTypePhrase, errorCodeLangPhrase){
    if (enterCodePhrase == null) {
        enterCodePhrase = "Enter the codes that you want to add.";
    }
    var text = prompt(enterCodePhrase, "");
Severity: Minor
Found in htdocs/include/xoops.js - About 2 hrs 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 apply_0523patch has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function apply_0523patch() {
        $patchCode = "
    foreach ( array('GLOBALS', '_SESSION', 'HTTP_SESSION_VARS', '_GET', 'HTTP_GET_VARS', '_POST', 'HTTP_POST_VARS', '_COOKIE', 'HTTP_COOKIE_VARS', '_REQUEST', '_SERVER', 'HTTP_SERVER_VARS', '_ENV', 'HTTP_ENV_VARS', '_FILES', 'HTTP_POST_FILES', 'xoopsDB', 'xoopsUser', 'xoopsUserId', 'xoopsUserGroups', 'xoopsUserIsAdmin', 'xoopsConfig', 'xoopsOption', 'xoopsModule', 'xoopsModuleConfig', 'xoopsRequestUri') as \$bad_global) {
        if (isset( \$_REQUEST[\$bad_global] )) {
            header( 'Location: '.XOOPS_URL.'/' );
Severity: Major
Found in upgrade/upd-2.0.13-to-2.0.14/index.php - About 2 hrs to fix

    Method protector_prepare has 56 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function protector_prepare() {
        // check the access is from install/index.php
        if (defined('_INSTALL_CHARSET') && !defined("XOOPS_MAINFILE_INCLUDED")) die('To use installer, remove the following plugin first: /plugins/preload/protector.php');
    
        // Protector class

      Method imanager_updateimage has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function imanager_updateimage() {
          /* because we are using a function, the GET/POST variables are not in scope */
          global $image_id, $image_display, $image_weight, $image_nicename, $imgcat_id;
      
          if (!icms::$security->check()) {
      Severity: Major
      Found in htdocs/modules/system/admin/images/browser.php - About 2 hrs to fix

        File misc.php has 260 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        // $Id: misc.php 12399 2014-01-25 17:02:01Z skenow $
        //  ------------------------------------------------------------------------ //
        //                XOOPS - PHP Content Management System                      //
        //                    Copyright (c) 2000 XOOPS.org                           //
        Severity: Minor
        Found in htdocs/misc.php - About 2 hrs to fix

          Method imanager_delcatok has 56 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function imanager_delcatok($imgcat_id) {
              if (!icms::$security->check()) {
                  redirect_header('admin.php?fct=images', 3, implode('<br />', icms::$security->getErrors()));
              }
          
          
          Severity: Major
          Found in htdocs/modules/system/admin/images/main.php - About 2 hrs to fix

            Method system_get_plugin_info has 54 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function system_get_plugin_info($dirname , $language = 'english') {
                // get $mytrustdirname for D3 modules
                $mytrustdirname = '' ;
                if (defined('XOOPS_TRUST_PATH') && file_exists(ICMS_MODULES_PATH . "/" . $dirname . "/mytrustdirname.php")) {
                    @include ICMS_MODULES_PATH . "/" . $dirname . "/mytrustdirname.php" ;
            Severity: Major
            Found in htdocs/modules/system/blocks/system_waiting.php - About 2 hrs to fix

              File autotasks.php has 256 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              /**
               * ImpressCMS AUTOTASKS
               *
               * @copyright    The ImpressCMS Project http://www.impresscms.org/
              Severity: Minor
              Found in htdocs/modules/system/admin/autotasks/class/autotasks.php - About 2 hrs to fix

                File main.php has 256 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                // $Id: main.php 12313 2013-09-15 21:14:35Z skenow $
                //  ------------------------------------------------------------------------ //
                //                XOOPS - PHP Content Management System                      //
                //                    Copyright (c) 2000 XOOPS.org                           //
                Severity: Minor
                Found in htdocs/modules/system/admin/modulesadmin/main.php - About 2 hrs to fix

                  Function xoopsCodeText has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function xoopsCodeText(id, hiddentext, enterTextboxPhrase){
                      var textareaDom = xoopsGetElementById(id);
                      var textDom = xoopsGetElementById(id + "Addtext");
                      var fontDom = xoopsGetElementById(id + "Font");
                      var colorDom = xoopsGetElementById(id + "Color");
                  Severity: Major
                  Found in htdocs/include/xoops.js - About 2 hrs to fix

                    Method confirmForm has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function confirmForm() {
                            $yesno = empty($this->db_pconnect) ? _INSTALL_L24 : _INSTALL_L23;
                            $ret =
                                "<table border='0' cellpadding='0' cellspacing='0' valign='top' width='90%'><tr><td class='bg2'>
                                    <table width='100%' border='0' cellpadding='4' cellspacing='1'>
                    Severity: Major
                    Found in htdocs/install/class/settingmanager.php - About 2 hrs to fix

                      Function xoopsCodeImg has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function xoopsCodeImg(id, enterImgUrlPhrase, enterImgPosPhrase, imgPosRorLPhrase, errorImgPosPhrase){
                          if (enterImgUrlPhrase == null) {
                              enterImgUrlPhrase = "Enter the URL of the image you want to add:";
                          }
                          var text = prompt(enterImgUrlPhrase, "");
                      Severity: Minor
                      Found in htdocs/include/xoops.js - About 2 hrs 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 TCDraw has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function TCDraw(o_win, o_doc) {
                          this.win = o_win;
                          this.doc = o_doc;
                          var 
                          s_tag_openT  = o_doc.layers ? 
                      Severity: Minor
                      Found in htdocs/include/color-picker.js - About 2 hrs 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 readRequest has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                      Open

                          function readRequest() {
                              if ($_SERVER['REQUEST_METHOD'] == 'POST') {
                                  $request = $_POST;
                                  /*
                                   $request = xo_input_get_args( INPUT_POST, array(
                      Severity: Minor
                      Found in htdocs/install/page_pathsettings.php - About 2 hrs 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 synchronize has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function synchronize($id, $type) {
                          switch($type) {
                              case 'user':
                                  // Array of tables from which to count 'posts'
                                  $tables = array();
                      Severity: Minor
                      Found in htdocs/modules/system/admin/users/users.php - About 2 hrs 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 exec has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function exec() {
                              if (!$this->getVar('sat_enabled')) return FALSE;
                              if (((int) $this->getVar('sat_lastruntime') + (int) $this->getVar('sat_interval') * 60) > time()) return FALSE;
                              $code = $this->getVar('sat_code');
                              ignore_user_abort(TRUE);
                      Severity: Minor
                      Found in htdocs/modules/system/admin/autotasks/class/autotasks.php - About 2 hrs 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 ip_match has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                      Open

                          function ip_match($ips) {
                              foreach ($ips as $ip => $info) {
                                  if ($ip) {
                                      switch (substr($ip, -1)) {
                                          case '.':

                      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 redirect_header has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function redirect_header($url, $time = 3, $message = '', $addredirect = true, $allowExternalLink = false)
                      {
                          global $icmsConfig, $icmsConfigPersona;
                          if(preg_match("/[\\0-\\31]|about:|script:/i", $url))
                          {
                      Severity: Major
                      Found in htdocs/include/functions.php - About 2 hrs to fix

                        Method check has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                function check($post = true, $area = '', $allow_repost = true) {
                                    global $xoopsModule;
                        
                                    $this->_errors = array ();
                        
                        

                          Function clonePosition has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function clonePosition(element, source, options) {
                                  options = Object.extend({
                                      setLeft:    true,
                                      setTop:     true,
                                      setWidth:   true,
                          Severity: Minor
                          Found in htdocs/install/prototype.js - About 2 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language