ImpressCMS/impresscms

View on GitHub

Showing 47,251 of 47,256 total issues

Function eliminate_dotdot has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    function eliminate_dotdot() {
        if ($this->_done_dotdot)
            return true;
        else
            $this->_done_dotdot = 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 purge has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    function purge($redirect_to_top = false) {
        // clear all session values
        if (isset($_SESSION)) foreach ($_SESSION as $key => $val) {
            $_SESSION[$key] = '';
            if (isset($GLOBALS[$key])) $GLOBALS[$key] = '';

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

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

        $filters = 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 b_system_online_show has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

function b_system_online_show() {
    $online_handler = icms::handler('icms_core_Online');
    mt_srand((double) microtime() * 1000000);
    // set gc probabillity to 10% for now..
    if (mt_rand(1, 100) < 11) {
Severity: Minor
Found in htdocs/modules/system/blocks/system_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

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

                    if (isset($config['options']) && is_array($config['options'])) {
                        foreach ($config['options'] as $key => $value) {
                            $confop =& $config_handler->createConfigOption();
                            $confop->setVar('confop_name', $key, true);
                            $confop->setVar('confop_value', $value, true);
Severity: Major
Found in htdocs/install/modulesadmin.php and 1 other location - About 1 hr to fix
htdocs/install/modulesadmin.php on lines 292..301

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

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

                        if (isset($config['options']) && is_array($config['options'])) {
                            foreach ($config['options'] as $key => $value) {
                                $confop =& $config_handler->createConfigOption();
                                $confop->setVar('confop_name', $key, true);
                                $confop->setVar('confop_value', $value, true);
Severity: Major
Found in htdocs/install/modulesadmin.php and 1 other location - About 1 hr to fix
htdocs/install/modulesadmin.php on lines 808..817

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

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 select has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    select = Sizzle.select = function( selector, context, results, seed ) {
        var i, tokens, token, type, find,
            compiled = typeof selector === "function" && selector,
            match = !seed && tokenize( (selector = compiled.selector || selector) );

Severity: Minor
Found in htdocs/install/prototype.js - About 1 hr to fix

    Function superfish has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        $.fn.superfish = function(op){
    
            var sf = $.fn.superfish,
                c = sf.c,
                $arrow = $(['<span class="',c.arrowClass,'"> &#187;</span>'].join('')),
    Severity: Minor
    Found in htdocs/themes/reflex/js/superfish.js - About 1 hr to fix

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

      <?php
      ######################## Added in 1.2 ###################################
      define('_AM_SYSTEM_PAGES_TITLE', 'Symlink Beheerder');
      define('_AM_SYSTEM_PAGES_CREATE', 'Nieuwe Symlink toevoegen');
      define('_AM_SYSTEM_PAGES_EDIT', 'Symlink aanpassen');
      Severity: Major
      Found in htdocs/modules/system/language/nederlands/admin/pages.php and 2 other locations - About 1 hr to fix
      htdocs/modules/system/language/english/admin/pages.php on lines 1..14
      htdocs/modules/system/language/italiano/admin/pages.php on lines 1..13

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

      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

      <?php
      ######################## Added in 1.2 ###################################
      define('_AM_SYSTEM_PAGES_TITLE','Symlink Manager');
      
      define('_AM_SYSTEM_PAGES_CREATE','Aggiungi nuovo Symlink');
      Severity: Major
      Found in htdocs/modules/system/language/italiano/admin/pages.php and 2 other locations - About 1 hr to fix
      htdocs/modules/system/language/english/admin/pages.php on lines 1..14
      htdocs/modules/system/language/nederlands/admin/pages.php on lines 1..12

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

      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

      <?php
      ######################## Added in 1.2 ###################################
      define('_AM_SYSTEM_PAGES_TITLE','Symlink Manager');
      
      define('_AM_SYSTEM_PAGES_CREATE','Add new Symlink');
      Severity: Major
      Found in htdocs/modules/system/language/english/admin/pages.php and 2 other locations - About 1 hr to fix
      htdocs/modules/system/language/italiano/admin/pages.php on lines 1..13
      htdocs/modules/system/language/nederlands/admin/pages.php on lines 1..12

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

      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 apply_auth_db has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function apply_auth_db() {
              $db = $GLOBALS['xoopsDB'];
      
              $cat = getDbValue( $db, 'configcategory', 'confcat_id', "`confcat_name` ='_MD_AM_AUTHENTICATION'" );
              if ($cat !== false && $cat != XOOPS_CONF_AUTH) {
      Severity: Minor
      Found in upgrade/upd-2.0.13-to-2.0.14/index.php - About 1 hr to fix

        Function tokenize has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function tokenize( selector, parseOnly ) {
                var matched, match, tokens, type,
                    soFar, groups, preFilters,
                    cached = tokenCache[ selector + " " ];
        
        
        Severity: Minor
        Found in htdocs/install/prototype.js - About 1 hr to fix

          Method doRewrite has 46 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function doRewrite() {
                  clearstatcache();
                  if (! $file = fopen($this->path,"r")) {
                      $this->error = true;
                      return false;
          Severity: Minor
          Found in htdocs/install/class/mainfilemanager.php - About 1 hr to fix

            Method ext_date has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function ext_date($time)
            {
                icms_loadLanguageFile('core', 'calendar');
                /*        $string = str_replace(
                    array(_CAL_AM, _CAL_PM, _CAL_AM_LONG, _CAL_PM_LONG, _CAL_SAT, _CAL_SUN, _CAL_MON, _CAL_TUE, _CAL_WED, _CAL_THU, _CAL_FRI, _CAL_SATURDAY, _CAL_SUNDAY, _CAL_MONDAY, _CAL_TUESDAY, _CAL_WEDNESDAY, _CAL_THURSDAY, _CAL_FRIDAY),
            Severity: Minor
            Found in htdocs/include/functions.php - About 1 hr to fix

              Method b_system_bookmarks_show has 45 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function b_system_bookmarks_show() {
                  global $icmsConfig;
                  $block = array();
                  icms_loadLanguageFile('core', 'notification');
                  // User must be logged in
              Severity: Minor
              Found in htdocs/modules/system/blocks/system_blocks.php - About 1 hr to fix

                Method b_system_online_show has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function b_system_online_show() {
                    $online_handler = icms::handler('icms_core_Online');
                    mt_srand((double) microtime() * 1000000);
                    // set gc probabillity to 10% for now..
                    if (mt_rand(1, 100) < 11) {
                Severity: Minor
                Found in htdocs/modules/system/blocks/system_blocks.php - About 1 hr to fix

                  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;
                        Severity
                        Category
                        Status
                        Source
                        Language