ImpressCMS/impresscms

View on GitHub

Showing 47,251 of 47,256 total issues

Function bigumbrella_outputcheck has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    function bigumbrella_outputcheck($s) {
        if (defined('BIGUMBRELLA_DISABLED')) return $s;

        if (function_exists('headers_list')) {
            foreach (headers_list() as $header) {

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

    function check_sql_isolatedcommentin($sanitize = true) {
        if ($this->_done_isocom)
            return $this->_safe_isocom;
        else
            $this->_done_isocom = 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 _initial_recursive has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    function _initial_recursive($val, $key) {
        if (is_array($val)) {
            foreach ($val as $subkey => $subval) {
                // check bad globals
                if (in_array($subkey, $this->_bad_globals, 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 imanager_addcat has a Cognitive Complexity of 12 (exceeds 5 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: Minor
Found in htdocs/modules/system/admin/images/browser.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_comments_show has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

function b_system_comments_show($options) {
    $block = array();
    include_once ICMS_ROOT_PATH . '/include/comment_constants.php';
    $comment_handler = icms::handler('icms_data_comment');
    $criteria = new icms_db_criteria_Compo(new icms_db_criteria_Item('com_status', XOOPS_COMMENT_ACTIVE));
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

Method apply_profile has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function apply_profile()
    {
        $xoopsDB = $GLOBALS['xoopsDB'];
        // Restore users table
        $xoopsDB->queryF(
Severity: Minor
Found in upgrade/cnt-2.2.x-to-2.0.x/index.php - About 1 hr to fix

    Function cookie has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    jQuery.cookie = function(name, value, options) {
        if (typeof value != 'undefined') { // name and value given, set cookie
            options = options || {};
            if (value === null) {
                value = '';
    Severity: Minor
    Found in htdocs/themes/reflex/js/cookie.js - About 1 hr to fix

      Method ip_match has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function ip_match($ips) {
              foreach ($ips as $ip => $info) {
                  if ($ip) {
                      switch (substr($ip, -1)) {
                          case '.':

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

            function observeCustomEvent(element, eventName, responder) {
                if (element.addEventListener) {
                    element.addEventListener('dataavailable', responder, false);
                } else {
                    element.attachEvent('ondataavailable', responder);
        Severity: Major
        Found in htdocs/install/prototype.js and 1 other location - About 1 hr to fix
        htdocs/install/prototype.js on lines 7059..7066

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

        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

                    'padding-box-width': function(element) {
                        var width = this.get('width'),
                            pLeft = this.get('padding-left'),
                            pRight = this.get('padding-right');
        
        
        Severity: Major
        Found in htdocs/install/prototype.js and 1 other location - About 1 hr to fix
        htdocs/install/prototype.js on lines 3819..3825

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

        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

            function stopObservingCustomEvent(element, eventName, responder) {
                if (element.removeEventListener) {
                    element.removeEventListener('dataavailable', responder, false);
                } else {
                    element.detachEvent('ondataavailable', responder);
        Severity: Major
        Found in htdocs/install/prototype.js and 1 other location - About 1 hr to fix
        htdocs/install/prototype.js on lines 7019..7026

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

        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

                    'padding-box-height': function(element) {
                        var height = this.get('height'),
                            pTop = this.get('padding-top'),
                            pBottom = this.get('padding-bottom');
        
        
        Severity: Major
        Found in htdocs/install/prototype.js and 1 other location - About 1 hr to fix
        htdocs/install/prototype.js on lines 3827..3833

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

        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

        $modversion['config'][] = array(
            'name' => 'dos_f5action',
            'title' => $constpref . '_DOS_F5ACTION',
            'description' => '',
            'formtype' => 'select',
        htdocs/install/modules/protector/trust_path/modules/protector/icms_version.php on lines 242..255

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

        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 ($pm->getVar("to_userid") == (int) (icms::$user->getVar('uid'))) {
                        $pm_uname = icms_member_user_Object::getUnameFromId($pm->getVar("from_userid"));
                        $message  = "[quote]\n"
                            . sprintf(_PM_USERWROTE, $pm_uname)
                            . "\n" . $pm->getVar("msg_text", "E") . "\n[/quote]";
        Severity: Major
        Found in htdocs/pmlite.php and 1 other location - About 1 hr to fix
        htdocs/pmlite.php on lines 125..133

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

        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 ($tplset != 'default') {
                        $physical_file = ICMS_THEME_PATH . '/' . $tplset . '/templates/' . $moddir . '/' . $filename;
                        if (file_exists($physical_file)) {
                            $mtime = filemtime($physical_file);
                            if ($last_imported < $mtime) {
        Severity: Major
        Found in htdocs/modules/system/admin/tplsets/main.php and 1 other location - About 1 hr to fix
        htdocs/modules/system/admin/tplsets/main.php on lines 290..316

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

        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 ($tplset != 'default') {
                        if (file_exists($physical_file)) {
                            $mtime = filemtime($physical_file);
                            if ($last_imported < $mtime) {
                                if ($mtime > $last_modified) {
        Severity: Major
        Found in htdocs/modules/system/admin/tplsets/main.php and 1 other location - About 1 hr to fix
        htdocs/modules/system/admin/tplsets/main.php on lines 210..239

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

        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 ($pm->getVar("to_userid") == (int) (icms::$user->getVar('uid'))) {
                        $pm_uname = icms_member_user_Object::getUnameFromId($pm->getVar("from_userid"));
                        $message  = "[quote]\n"
                            . sprintf(_PM_USERWROTE, $pm_uname)
                            . "\n" . $pm->getVar("msg_text", "E") . "\n[/quote]";
        Severity: Major
        Found in htdocs/pmlite.php and 1 other location - About 1 hr to fix
        htdocs/pmlite.php on lines 163..171

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

        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

        $modversion['config'][] = array(
            'name' => 'dos_craction',
            'title' => $constpref . '_DOS_CRACTION',
            'description' => '',
            'formtype' => 'select',
        htdocs/install/modules/protector/trust_path/modules/protector/icms_version.php on lines 220..233

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

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

        function xoopsCodeCode(id, enterCodePhrase, enterCodeLangPhrase, CodeLangTypePhrase, errorCodeLangPhrase){
            if (enterCodePhrase == null) {
                enterCodePhrase = "Enter the codes that you want to add.";
            }
            var text = prompt(enterCodePhrase, "");
        Severity: Minor
        Found in htdocs/include/xoops.js - About 1 hr to fix

          Function addMethods has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function addMethods(methods) {
                  if (arguments.length === 0) addFormMethods();
          
                  if (arguments.length === 2) {
                      var tagName = methods;
          Severity: Minor
          Found in htdocs/install/prototype.js - About 1 hr to fix
            Severity
            Category
            Status
            Source
            Language