ImpressCMS/impresscms

View on GitHub

Showing 47,251 of 47,256 total issues

Method editblock has 34 lines of code (exceeds 25 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

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

        function getUniqueElementID(element) {
            if (element === window) return 0;
    
            if (typeof element._prototypeUID === 'undefined')
                element._prototypeUID = Element.Storage.UID++;
    Severity: Major
    Found in htdocs/install/prototype.js and 1 other location - About 1 hr to fix
    htdocs/install/prototype.js on lines 6910..6916

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 62.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

        function getUniqueElementID(element) {
            if (element === window) return 0;
    
            if (typeof element._prototypeUID === 'undefined')
                element._prototypeUID = Element.Storage.UID++;
    Severity: Major
    Found in htdocs/install/prototype.js and 1 other location - About 1 hr to fix
    htdocs/install/prototype.js on lines 3221..3227

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 62.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Consider simplifying this complex logical expression.
    Open

                                } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
                                    diff = cache[1];
    
                                } else {
                                    while ( (node = ++nodeIndex && node && node[ dir ] ||
    Severity: Critical
    Found in htdocs/install/prototype.js - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

                      if (value != null && element.type != 'file' && (element.type != 'submit' || (!submitted &&
                          submit !== false && (!submit || key == submit) && (submitted = true)))) {
                          result = accumulator(result, key, value);
                      }
      Severity: Critical
      Found in htdocs/install/prototype.js - About 1 hr to fix

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                    if (isset($request['ROOT_PATH'])) {
                        $request['ROOT_PATH'] = str_replace( "\\", "/", $request['ROOT_PATH'] );
                        if (substr( $request['ROOT_PATH'], -1 ) == '/') {
                            $request['ROOT_PATH'] = substr( $request['ROOT_PATH'], 0, -1 );
                        }
        Severity: Major
        Found in htdocs/install/page_pathsettings.php and 1 other location - About 1 hr to fix
        htdocs/install/page_pathsettings.php on lines 103..109

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 107.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                    if (isset($request['TRUST_PATH'])) {
                        $request['TRUST_PATH'] = str_replace( "\\", "/", $request['TRUST_PATH'] );
                        if (substr( $request['TRUST_PATH'], -1 ) == '/') {
                            $request['TRUST_PATH'] = substr( $request['TRUST_PATH'], 0, -1 );
                        }
        Severity: Major
        Found in htdocs/install/page_pathsettings.php and 1 other location - About 1 hr to fix
        htdocs/install/page_pathsettings.php on lines 96..102

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 107.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Function xoopsValidate has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function xoopsValidate(subjectId, textareaId, submitId, plzCompletePhrase, msgTooLongPhrase, allowedCharPhrase, currCharPhrase) {
            var maxchars = 65535;
            var subjectDom = xoopsGetElementById(subjectId);
            var textareaDom = xoopsGetElementById(textareaId);
            var submitDom = xoopsGetElementById(submitId);
        Severity: Minor
        Found in htdocs/include/xoops.js - About 1 hr to fix

          Function keynav has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            $.fn.keynav = function (onClass,offClass) {
                //Initialization
                var kn = $.keynav;
                if(!kn.init) {
                    kn.el = new Array();
          Severity: Minor
          Found in htdocs/themes/reflex/js/jquery.keynav.js - About 1 hr to fix

            Method icms_html2text has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function icms_html2text($document)
            {
                // PHP Manual:: function preg_replace
                // $document should contain an HTML document.
                // This will remove HTML tags, javascript sections
            Severity: Minor
            Found in htdocs/include/functions.php - About 1 hr to fix

              Method icms_getModuleConfig has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function &icms_getModuleConfig($moduleName = false)
              {
                  static $icmsConfigs;
                  if(isset ($icmsConfigs[$moduleName]))
                  {
              Severity: Minor
              Found in htdocs/include/functions.php - About 1 hr to fix

                Method b_system_notification_show has 33 lines of code (exceeds 25 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

                  Function xoopsCodeImg has 32 lines of code (exceeds 25 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 1 hr to fix

                    Function addItem has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function addItem(itemurl, name, target, cat, url, type) {
                        var win = opener;
                        var campo = win.document.getElementById(target);
                        var opcoes = win.document.getElementById('img_cat_'+cat);
                        var imagem = win.document.getElementById(target+'_img');
                    Severity: Minor
                    Found in htdocs/modules/system/admin/images/js/imanager.js - About 1 hr to fix

                      Method jalali_to_gregorian has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function jalali_to_gregorian($j_y, $j_m, $j_d) {
                          $g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
                          $j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
                      
                          $jy = $j_y-979;
                      Severity: Minor
                      Found in htdocs/include/jalali.php - About 1 hr to fix

                        Method intval_allrequestsendid has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

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

                          Method execute has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function execute($type) {
                                  $ret = 0;
                          
                                  $filters = array ();
                          
                          

                            Method editcustomtag has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function editcustomtag($customtagid = 0, $clone = FALSE) {
                                global $icms_customtag_handler, $icmsAdminTpl, $customtagid;
                            
                                icms_cp_header();
                                $customtagObj = $icms_customtag_handler->get($customtagid);
                            Severity: Minor
                            Found in htdocs/modules/system/admin/customtag/main.php - About 1 hr to fix

                              Method synchronize has 32 lines of code (exceeds 25 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 1 hr to fix

                                Identical blocks of code found in 10 locations. Consider refactoring.
                                Open

                                    if (is_array($groups) && !empty($groups)) {
                                        $criteriaTray = new icms_db_criteria_Compo();
                                        foreach ($groups as $gid) {
                                            $criteriaTray->add(new icms_db_criteria_Item('gperm_groupid', $gid), 'OR');
                                        }
                                Severity: Major
                                Found in htdocs/modules/system/admin/images/browser.php and 9 other locations - About 1 hr to fix
                                htdocs/modules/system/admin/images/browser.php on lines 170..178
                                htdocs/modules/system/admin/images/browser.php on lines 234..242
                                htdocs/modules/system/admin/images/browser.php on lines 250..258
                                htdocs/modules/system/admin/images/browser.php on lines 409..417
                                htdocs/modules/system/admin/images/main.php on lines 190..198
                                htdocs/modules/system/admin/images/main.php on lines 255..263
                                htdocs/modules/system/admin/images/main.php on lines 272..280
                                htdocs/modules/system/admin/images/main.php on lines 420..428
                                htdocs/modules/system/admin/images/main.php on lines 437..445

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 106.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Severity
                                Category
                                Status
                                Source
                                Language