ImpressCMS/impresscms

View on GitHub

Showing 540 of 47,256 total issues

Function getPixelValue has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function getPixelValue(value, property, context) {
        var element = null;
        if (Object.isElement(value)) {
            element = value;
            value = getRawStyle(element, property);
Severity: Minor
Found in htdocs/install/prototype.js - About 1 hr to fix

    Function matcherFromTokens has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function matcherFromTokens( tokens ) {
            var checkContext, matcher, j,
                len = tokens.length,
                leadingRelative = Expr.relative[ tokens[0].type ],
                implicitRelative = leadingRelative || Expr.relative[" "],
    Severity: Minor
    Found in htdocs/install/prototype.js - About 1 hr to fix

      Method check_uploaded_files has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function check_uploaded_files() {
              if ($this->_done_badext)
                  return $this->_safe_badext;
              else
                  $this->_done_badext = true;

        Function xoopsCodeUrl has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        function xoopsCodeUrl(id, enterUrlPhrase, enterWebsitePhrase){
            if (enterUrlPhrase == null) {
                enterUrlPhrase = "Enter the URL of the link you want to add:";
            }
            var text = prompt(enterUrlPhrase, "");
        Severity: Minor
        Found in htdocs/include/xoops.js - 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 lastday has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        function lastday ($month,$day,$year) {
            $lastdayen=date('d',mktime(0,0,0,$month+1,0,$year));
            list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($year, $month, $day);
            $lastdatep=$jday;
            while ($jday!='1')
        Severity: Minor
        Found in htdocs/include/jalali.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 showNav has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        function showNav($id = null, $separador = '/', $style="style='font-weight:bold'")
        {
            $url = ICMS_URL.'/content.php';
            if($id == false) {return false;}
            else
        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

        Function draw_repost_form has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

                function draw_repost_form($area = '') {
                    // Notify which file is broken
                    if (headers_sent()) {
                        restore_error_handler();
                        set_error_handler(array (

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

        function editblock($bid = 0, $clone = FALSE) {
            global $icms_block_handler, $icmsAdminTpl;
        
            $blockObj = $icms_block_handler->get($bid);
        
        
        Severity: Minor
        Found in htdocs/modules/system/admin/blocksadmin/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_admin_cp_new_show has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        function b_system_admin_cp_new_show() {
            global $icmsTpl, $icmsConfig;
        
            $block['lang_cp'] = _CPHOME;
        
        
        Severity: Minor
        Found in htdocs/modules/system/blocks/system_admin_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 b_system_admin_cp_show has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        function b_system_admin_cp_show() {
            global $icmsTpl, $icmsConfig;
        
            $block['lang_cp'] = _CPHOME;
            $block['lang_insmodules'] = _AD_INSTALLEDMODULES;
        Severity: Minor
        Found in htdocs/modules/system/blocks/system_admin_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 _begin has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                _begin: function() {
                    if (this._isPrepared()) return;
        
                    var element = this.element;
                    if (isDisplayed(element)) {
        Severity: Minor
        Found in htdocs/install/prototype.js - About 1 hr to fix

          Method disable_features has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function disable_features() {
          
                  // disable "Notice: Undefined index: ..."
                  $error_reporting_level = error_reporting(0);
          
          

            Method convert_table has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function convert_table($tables, $charset, $collation) {
                    // Initialize vars.
                    $string_querys = array();
                    $binary_querys = array();
                    $gen_index_querys = array();
            Severity: Minor
            Found in upgrade/upd-icms-1.0-to-1.1/index.php - About 1 hr to fix

              Method icms_wordwrap has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function icms_wordwrap($str, $width, $break = '/n', $cut = false)
              {
                  if(strtolower(_CHARSET) !== 'utf-8')
                  {
                      $str = wordwrap($str, $width, $break, $cut);
              Severity: Minor
              Found in htdocs/include/functions.php - About 1 hr to fix

                Method editform has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function editform() {
                        $ret =
                            "<table width='100%' class='outer' cellspacing='5'>
                                <tr>
                                    <th colspan='2'></th>
                Severity: Minor
                Found in htdocs/install/class/settingmanager.php - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                      if ( text != null && text != "" ) {
                          if (enterImgPosPhrase == null) {
                              enterImgPosPhrase = "Now, enter the position of the image.";
                          }
                          if (imgPosRorLPhrase == null) {
                  Severity: Critical
                  Found in htdocs/include/xoops.js - About 1 hr to fix

                    Method write_mainfile has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function write_mainfile($vars) {
                            if (empty($vars)) {
                                return false;
                            }
                    
                    
                    Severity: Minor
                    Found in upgrade/upd-icms-1.0-to-1.1/index.php - About 1 hr to fix

                      Method b_system_social_show has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function b_system_social_show($options) {
                          $block = array();
                          $block['provider'] = array();
                      
                          $i = 0;
                      Severity: Minor
                      Found in htdocs/modules/system/blocks/system_blocks.php - About 1 hr to fix

                        Function getElementsByClassName has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                        Open

                        if (!document.getElementsByClassName) document.getElementsByClassName = function(instanceMethods){
                            function iter(name) {
                                return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]";
                            }
                        
                        
                        Severity: Minor
                        Found in htdocs/install/prototype.js - 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 icms_getModuleInfo has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function &icms_getModuleInfo($moduleName = false)
                        {
                            static $icmsModules;
                            if(isset($icmsModules[$moduleName]))
                            {
                        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