ImpressCMS/impresscms

View on GitHub

Showing 540 of 47,256 total issues

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

    function navigate(direction) {
        // Check if any of the menu items is selected
        if(jQuery("#suggestions ul li .itemhover").size() == 0) {
            currentSelection = -1;
        }
Severity: Minor
Found in htdocs/themes/reflex/js/quicksearch.js - 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 xoopsSmilies has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

function xoopsSmilies($textarea_id)
{
    icms_core_Debug::setDeprecated('icms_form_elements_Dhtmltextarea.', sprintf(_CORE_REMOVE_IN_VERSION, '2.0'));
    $smiles =& icms_core_DataFilter::getSmileys();
    if (empty($smileys)) {
Severity: Minor
Found in htdocs/include/xoopscodes.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 getDirList has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

function getDirList($dirname) {
    $dirlist = array();
    if (is_dir($dirname) && $handle = opendir($dirname)) {
        while (false !== ($file = readdir($handle))) {
            if (substr( $file, 0, 1 ) != '.'  && strtolower($file) != 'cvs') {
Severity: Minor
Found in upgrade/index.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 xoops_getcss has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

function xoops_getcss($theme = '')
{
    if($theme == '') {$theme = $GLOBALS['icmsConfig']['theme_set'];}
    $uagent = xoops_getenv('HTTP_USER_AGENT');
    if(stristr($uagent, 'mac')) {$str_css = 'styleMAC.css';}
Severity: Minor
Found in htdocs/include/functions.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 getSystemHandlersList has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function getSystemHandlersList($checkIfItIsAvaibleOnCurrentSystem = TRUE) {
        static $ret = NULL;
        if ($ret === NULL) {
            $files = glob($this->getSystemHandlerFileName('*'));
            $ret = FALSE;
Severity: Minor
Found in htdocs/modules/system/admin/autotasks/class/autotasks.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 report has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function report() {
        $commands = array( 'create', 'insert', 'alter', 'drop' );
        $content = '<ul class="log">';
        foreach ( $commands as $cmd) {
            if (!@empty( $this->s_tables[$cmd] )) {
Severity: Minor
Found in htdocs/install/class/dbmanager.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 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 '.':

        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

            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

              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

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