ImpressCMS/impresscms

View on GitHub

Showing 540 of 47,256 total issues

TextSanitizer has 28 functions (exceeds 20 allowed). Consider refactoring.
Open

class TextSanitizer {

    /*
     * Constructor of this class
     * Gets allowed html tags from admin config settings
Severity: Minor
Found in htdocs/install/class/textsanitizer.php - About 3 hrs to fix

    Method Icms_getMonthNameById has 82 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function Icms_getMonthNameById($month_id) {
        global $icmsConfig;
        icms_loadLanguageFile('core', 'calendar');
        $month_id = icms_conv_local2nr($month_id);
        if( $icmsConfig['use_ext_date'] == true && defined ('_CALENDAR_TYPE') && _CALENDAR_TYPE == "jalali"){
    Severity: Major
    Found in htdocs/include/functions.php - About 3 hrs to fix

      Method check_dos_attack has 82 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function check_dos_attack($uid = 0, $can_ban = false) {
              if ($this->_done_dos) return true;
      
              $ip4sql = filter_input(INPUT_SERVER, 'REMOTE_ADDR', FILTER_VALIDATE_IP);
              $uri4sql = filter_input(INPUT_SERVER, 'REQUEST_URI', FILTER_SANITIZE_STRING);

        Function xoops_comment_delete has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

        function xoops_comment_delete($module_id, $item_id)
        {
            if( (int) ($module_id) > 0 && (int) ($item_id) > 0)
            {
                $comment_handler = icms::handler('icms_data_comment');
        Severity: Minor
        Found in htdocs/include/functions.php - About 3 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 imanager_addfile has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

        function imanager_addfile() {
            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 3 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 imanager_addfile has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

        function imanager_addfile() {
            /* because we are using a function, the GET/POST variables are not in scope */
            global $imgcat_id, $image_display, $image_weight, $image_nicename;
        
            if (!icms::$security->check()) {
        Severity: Minor
        Found in htdocs/modules/system/admin/images/browser.php - About 3 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 b_system_info_show has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

        function b_system_info_show($options) {
            global $icmsConfig;
            $block = array();
            if (!empty($options[3])) {
                $block['showgroups'] = TRUE;
        Severity: Minor
        Found in htdocs/modules/system/blocks/system_blocks.php - About 3 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

        File page_pathsettings.php has 295 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /**
         * Installer paths configuration page
         *
         * See the enclosed file license.txt for licensing information.
        Severity: Minor
        Found in htdocs/install/page_pathsettings.php - About 3 hrs to fix

          Method protector_oninstall_base has 77 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function protector_oninstall_base($module, $mydirname) {
                  // transations on module install
                  global $ret; // TODO :-D
          
                  if (!is_array($ret)) $ret = array ();

            Function Sizzle has 76 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function Sizzle( selector, context, results, seed ) {
                    var match, elem, m, nodeType,
                        i, groups, old, nid, newContext, newSelector;
            
                    if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
            Severity: Major
            Found in htdocs/install/prototype.js - About 3 hrs to fix

              Method updateUser has 76 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function updateUser($uid, $uname, $login_name, $name, $url, $email, $user_icq, $user_aim, $user_yim,
                                  $user_msnm, $user_from, $user_occ, $user_intrest, $user_viewemail, $user_avatar,
                                  $user_sig, $attachsig, $theme, $pass, $pass2, $rank, $bio, $uorder, $umode, $notify_method,
                                  $notify_mode, $timezone_offset, $user_mailok, $language,
                                  $pass_expired, $groups = array()
              Severity: Major
              Found in htdocs/modules/system/admin/users/users.php - About 3 hrs to fix

                Function AdMenu has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function AdMenu(id) { this.type = "horizontal"; this.position = { "level1": { "top": 0, "left": 0}, "levelX": { "top": 0, "left": 0}
                }
                this.zIndex = { "visible": 1, "hidden": -1
                }
                this.arrow1 = null; this.arrow2 = null; this.browser = { "ie": Boolean(document.body.currentStyle), "ie5": (navigator.appVersion.indexOf("MSIE 5.5") != -1 || navigator.appVersion.indexOf("MSIE 5.0") != -1)
                Severity: Major
                Found in htdocs/include/icms_rtl.js - About 2 hrs to fix

                  Function impresscms_get_adminmenu has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function impresscms_get_adminmenu() {
                      $admin_menu = array();
                      $modules_menu = array();
                      $systemadm = false;
                  
                  
                  Severity: Minor
                  Found in htdocs/include/cp_functions.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 intval_allrequestsendid has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                  Open

                      function intval_allrequestsendid() {
                          if ($this->_done_intval)
                              return true;
                          else
                              $this->_done_intval = true;

                  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 AllowedModules has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function AllowedModules($mimetype, $module) {
                          $mimetypeid_allowed = $dirname_allowed = FALSE;
                          $GrantedItems = $this->UserCanUpload();
                          $criteria = new icms_db_criteria_Compo(new icms_db_criteria_Item('types', '%' . $mimetype . '%', 'LIKE'));
                  
                  
                  Severity: Minor
                  Found in htdocs/modules/system/admin/mimetype/class/mimetype.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

                  Method buildFormats has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function buildFormats() {
                          $this->adFormats['728x90_as'] = array(
                              'caption' => '728 X 90 Leaderboard',
                              'width' => 728,
                              'height' => 90,
                  Severity: Major
                  Found in htdocs/modules/system/admin/adsense/class/adsense.php - About 2 hrs to fix

                    Method xoInit has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function xoInit(): bool {
                            if (!$this->checkAccess()) {
                                return false;
                            }
                            if (@empty($_SERVER['REQUEST_URI'])) {
                    Severity: Major
                    Found in htdocs/install/class/IcmsInstallWizard.php - About 2 hrs to fix

                      File update-13.php has 284 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      /**
                       * DataBase Update Functions for ImpressCMS 1.3 series
                       *
                       * @copyright    The ImpressCMS Project http://www.impresscms.org/
                      Severity: Minor
                      Found in htdocs/modules/system/include/update-13.php - About 2 hrs to fix

                        Function scrollTo has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            $.fn.scrollTo = function( target, duration, settings ){
                                if( typeof duration == 'object' ){
                                    settings = duration;
                                    duration = 0;
                                }
                        Severity: Major
                        Found in htdocs/install/jquery.scrollTo.js - About 2 hrs to fix

                          Method imanager_addcat has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function imanager_addcat() {
                              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
                            Severity
                            Category
                            Status
                            Source
                            Language