ImpressCMS/impresscms

View on GitHub

Showing 47,251 of 47,256 total issues

Function TCGenerateMac has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

function TCGenerateMac() {
    var s = '';
    var c = 0,n = 1;
    var r,g,b;
    for (j = 0; j < 15; j ++) {
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 protector_onuninstall_base has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    function protector_onuninstall_base($module, $mydirname) {
        // transations on module uninstall
        global $ret; // TODO :-D

        if (!is_array($ret)) $ret = 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 imanager_addcat has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

function imanager_addcat() {
    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 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 matcherFromGroupMatchers has 68 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
        var bySet = setMatchers.length > 0,
            byElement = elementMatchers.length > 0,
            superMatcher = function( seed, context, xml, results, outermost ) {
                var elem, j, matcher,
Severity: Major
Found in htdocs/install/prototype.js - About 2 hrs to fix

    Function setMatcher has 66 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
            if ( postFilter && !postFilter[ expando ] ) {
                postFilter = setMatcher( postFilter );
            }
            if ( postFinder && !postFinder[ expando ] ) {
    Severity: Major
    Found in htdocs/install/prototype.js - About 2 hrs to fix

      File users.php has 276 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      // $Id: users.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/users/users.php - About 2 hrs to fix

        Function xoops_module_deactivate has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

        function xoops_module_deactivate($mid) {
            global $icms_page_handler, $icms_block_handler, $icmsConfig, $icmsAdminTpl;
            if (!isset($icms_page_handler)) {
                $icms_page_handler = icms_getModuleHandler('pages', 'system');
            }
        Severity: Minor
        Found in htdocs/modules/system/admin/modulesadmin/modulesadmin.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 adminNav has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

        function adminNav($id = NULL, $separador = "/", $list = FALSE, $style = "style='font-weight:bold'") {
            global $target, $type;
        
            $admin_url = 'browser.php?target=' . $target . '&type=' . $type;
            if ($id === FALSE) {
        Severity: Minor
        Found in htdocs/modules/system/admin/images/browser.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 adminNav has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

        function adminNav($id = NULL, $separador = "/", $list = FALSE, $style = "style='font-weight:bold'") {
            $admin_url = ICMS_MODULES_URL . "/system/admin.php?fct=images";
            if ($id === FALSE) {
                return FALSE;
            } else {
        Severity: Minor
        Found in htdocs/modules/system/admin/images/main.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 imanager_addcat has 64 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function imanager_addcat() {
            /* because we're using a function, the GET/POST variables are not in scope */
            global $imgcat_pid, $imgcat_name, $imgcat_maxsize;
            global $imgcat_maxwidth, $imgcat_maxheight, $imgcat_display;
            global $imgcat_weight, $imgcat_storetype, $imgcat_foldername;
        Severity: Major
        Found in htdocs/modules/system/admin/images/browser.php - About 2 hrs to fix

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

                              $cache_options = array('0' => _NOCACHE, '30' => sprintf(_SECONDS, 30), '60' => _MINUTE, '300' => sprintf(_MINUTES, 5), '1800' => sprintf(_MINUTES, 30), '3600' => _HOUR, '18000' => sprintf(_HOURS, 5), '86400' => _DAY, '259200' => sprintf(_DAYS, 3), '604800' => _WEEK);
          Severity: Major
          Found in htdocs/modules/system/admin/preferences/main.php and 1 other location - About 2 hrs to fix
          htdocs/modules/system/admin/preferences/main.php on lines 336..336

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

          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

                              $ele->addOptionArray(array('0' => _NOCACHE, '30' => sprintf(_SECONDS, 30), '60' => _MINUTE, '300' => sprintf(_MINUTES, 5), '1800' => sprintf(_MINUTES, 30), '3600' => _HOUR, '18000' => sprintf(_HOURS, 5), '86400' => _DAY, '259200' => sprintf(_DAYS, 3), '604800' => _WEEK));
          Severity: Major
          Found in htdocs/modules/system/admin/preferences/main.php and 1 other location - About 2 hrs to fix
          htdocs/modules/system/admin/preferences/main.php on lines 319..319

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

          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

          File main.php has 272 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/groups/main.php - About 2 hrs to fix

            Function Class has 63 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var Class = (function() {
            
                var IS_DONTENUM_BUGGY = (function(){
                    for (var p in { toString: 1 }) {
                        if (p === 'toString') return false;
            Severity: Major
            Found in htdocs/install/prototype.js - About 2 hrs to fix

              Method protector_onupdate_base has 62 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function protector_onupdate_base($module, $mydirname) {
                      // transations on module update
                      global $msgs; // TODO :-D
              
                      if (!is_array($msgs)) $msgs = array ();

                Method imanager_addfile has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function imanager_addfile() {
                    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 imanager_addfile has 62 lines of code (exceeds 25 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: Major
                  Found in htdocs/modules/system/admin/images/browser.php - About 2 hrs to fix

                    Function superMatcher has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                superMatcher = function( seed, context, xml, results, outermost ) {
                                    var elem, j, matcher,
                                        matchedCount = 0,
                                        i = "0",
                                        unmatched = seed && [],
                    Severity: Major
                    Found in htdocs/install/prototype.js - About 2 hrs to fix

                      Method queryFromFile has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function queryFromFile($sql_file_path) {
                              $tables = array();
                      
                              if (!file_exists($sql_file_path)) {
                                  return false;
                      Severity: Major
                      Found in htdocs/install/class/dbmanager.php - About 2 hrs to fix

                        Function xoopsCodeText has a Cognitive Complexity of 18 (exceeds 5 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: 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

                        Severity
                        Category
                        Status
                        Source
                        Language