ImpressCMS/impresscms

View on GitHub

Showing 47,251 of 47,256 total issues

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

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

            case "down" :
                $icms_block_handler->downWeight($clean_bid);
                $rtn = '/modules/system/admin.php?fct=blocksadmin';
                if (isset($_GET['sortsel'])) {
                    $rtn .= '&amp;sortsel=' . $sortsel . '&amp;ordersel=' . $ordersel . '&amp;limitsel=' . $limitsel . '&amp;startbid=' . $startbid;
    Severity: Major
    Found in htdocs/modules/system/admin/blocksadmin/main.php and 2 other locations - About 2 hrs to fix
    htdocs/modules/system/admin/blocksadmin/main.php on lines 138..149
    htdocs/modules/system/admin/blocksadmin/main.php on lines 151..162

    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 126.

    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 3 locations. Consider refactoring.
    Open

            case "up" :
                $icms_block_handler->upWeight($clean_bid);
                $rtn = '/modules/system/admin.php?fct=blocksadmin';
                if (isset($_GET['sortsel'])) {
                    $rtn .= '&amp;sortsel=' . $sortsel . '&amp;ordersel=' . $ordersel . '&amp;limitsel=' . $limitsel . '&amp;startbid=' . $startbid;
    Severity: Major
    Found in htdocs/modules/system/admin/blocksadmin/main.php and 2 other locations - About 2 hrs to fix
    htdocs/modules/system/admin/blocksadmin/main.php on lines 138..149
    htdocs/modules/system/admin/blocksadmin/main.php on lines 164..175

    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 126.

    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 3 locations. Consider refactoring.
    Open

            case 'visible' :
                $icms_block_handler->changeVisible($clean_bid);
                $rtn = '/modules/system/admin.php?fct=blocksadmin';
                if (isset($_GET['sortsel'])) {
                    $rtn .= '&amp;sortsel=' . $sortsel . '&amp;ordersel=' . $ordersel . '&amp;limitsel=' . $limitsel . '&amp;startbid=' . $startbid;
    Severity: Major
    Found in htdocs/modules/system/admin/blocksadmin/main.php and 2 other locations - About 2 hrs to fix
    htdocs/modules/system/admin/blocksadmin/main.php on lines 151..162
    htdocs/modules/system/admin/blocksadmin/main.php on lines 164..175

    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 126.

    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

    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

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

                          if (function_exists('xoops_module_install_' . $ModName)) {
                              $func = 'xoops_module_install_' . $ModName;
                              if (!($lastmsg = $func($module))) {
                                  $msgs[] = sprintf(_MD_AM_FAIL_EXEC, '<strong>' . $func . '</strong>');
                              } else {
          Severity: Major
          Found in htdocs/modules/system/admin/modulesadmin/modulesadmin.php and 1 other location - About 2 hrs to fix
          htdocs/modules/system/admin/modulesadmin/modulesadmin.php on lines 537..548

          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 124.

          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

                          } elseif (function_exists('icms_module_install_' . $ModName)) {
                              $func = 'icms_module_install_' . $ModName;
                              if (!($lastmsg = $func($module))) {
                                  $msgs[] = sprintf(_MD_AM_FAIL_EXEC, '<strong>' . $func . '</strong>');
                              } else {
          Severity: Major
          Found in htdocs/modules/system/admin/modulesadmin/modulesadmin.php and 1 other location - About 2 hrs to fix
          htdocs/modules/system/admin/modulesadmin/modulesadmin.php on lines 526..548

          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 124.

          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 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

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

                      if (isNaN(i)) {
                          i = 0;
                      } else if (i !== 0 && isFinite(i)) {
                          i = (i > 0 ? 1 : -1) * Math.floor(Math.abs(i));
                      }
              Severity: Major
              Found in htdocs/install/prototype.js and 1 other location - About 2 hrs to fix
              htdocs/install/prototype.js on lines 1225..1229

              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 77.

              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

                          'bottom': function(element) {
                              var parent = hasLayout(element.getOffsetParent());
                              var rect = element.getBoundingClientRect(),
                                  pRect = parent.getBoundingClientRect();
              
              
              Severity: Major
              Found in htdocs/install/prototype.js and 1 other location - About 2 hrs to fix
              htdocs/install/prototype.js on lines 3951..3957

              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 77.

              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 (isNaN(i)) {
                              i = 0;
                          } else if (i !== 0 && isFinite(i)) {
                              i = (i > 0 ? 1 : -1) * Math.floor(Math.abs(i));
                          }
              Severity: Major
              Found in htdocs/install/prototype.js and 1 other location - About 2 hrs to fix
              htdocs/install/prototype.js on lines 1202..1206

              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 77.

              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

                          'right': function(element) {
                              var parent = hasLayout(element.getOffsetParent());
                              var rect = element.getBoundingClientRect(),
                                  pRect = parent.getBoundingClientRect();
              
              
              Severity: Major
              Found in htdocs/install/prototype.js and 1 other location - About 2 hrs to fix
              htdocs/install/prototype.js on lines 3959..3965

              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 77.

              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

                      $dbm->insert('configoption', " VALUES (" . $ci++ . ", '_MD_AM_ENC_MD5', '20', $i)"
                          . ", (" . $ci++ . ", '_MD_AM_ENC_SHA256', '21', $i)"
                          . ", (" . $ci++ . ", '_MD_AM_ENC_SHA384', '22', $i)"
                          . ", (" . $ci++ . ", '_MD_AM_ENC_SHA512', '23', $i)"
                          . ", (" . $ci++ . ", '_MD_AM_ENC_RIPEMD128', '24', $i)"
              Severity: Major
              Found in htdocs/install/makedata.php and 1 other location - About 2 hrs to fix
              htdocs/install/makedata.php on lines 561..567

              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 123.

              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

                      $dbm->insert('configoption', " VALUES (" . $ci++ . ", '_MD_AM_BAR', '0', $i)"
                          . ", (" . $ci++ . ", '_MD_AM_CIRCLE', '1', $i)"
                          . ", (" . $ci++ . ", '_MD_AM_LINE', '2', $i)"
                          . ", (" . $ci++ . ", '_MD_AM_RECTANGLE', '3', $i)"
                          . ", (" . $ci++ . ", '_MD_AM_ELLIPSE', '4', $i)"
              Severity: Major
              Found in htdocs/install/makedata.php and 1 other location - About 2 hrs to fix
              htdocs/install/makedata.php on lines 373..379

              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 123.

              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 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

              Severity
              Category
              Status
              Source
              Language