ImpressCMS/impresscms

View on GitHub

Showing 540 of 47,256 total issues

Function icms_currency has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function icms_currency($var, $currencyObj=false)
{
    $ret = icms_getfloat($var,  array('single_dot_as_decimal'=> TRUE));
    $ret = round($ret, 2);
    // make sure we have at least .00 in the $var
Severity: Minor
Found in htdocs/include/functions.php - About 25 mins 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 apply_templates has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function apply_templates() {
        $db = $GLOBALS['xoopsDB'];
        $table = $db->prefix('tplfile');
        $table1 = $db->prefix('tplsource');
        $tpl_files = array(
Severity: Minor
Found in upgrade/upd-2.0.18-to-impresscms-1.0/index.php - About 25 mins 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 load_invite_code has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function load_invite_code($code) {
    // validate if code is of valid length.
    if (empty($code) || strlen($code) != 8) {
        header('Location: invite.php');
        // redirect_header('invite.php', 0, _US_INVITENONE);
Severity: Minor
Found in htdocs/include/checkinvite.php - About 25 mins 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 icms_getConfig has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function icms_getConfig($key, $moduleName = false, $default = 'default_is_undefined')
{
    if(!$moduleName) {$moduleName = icms_getCurrentModuleName();}
    $configs = icms_getModuleConfig($moduleName);
    if(isset($configs[$key])) {return $configs[$key];}
Severity: Minor
Found in htdocs/include/functions.php - About 25 mins 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 icms_cp_footer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function icms_cp_footer() {
    global $xoopsOption, $xoTheme;
    icms::$logger->stopTime('Module display');

    if (!headers_sent()) {
Severity: Minor
Found in htdocs/include/cp_functions.php - About 25 mins 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_module_gettemplate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function &xoops_module_gettemplate($dirname, $template, $block=false) {
    $ret = '';
    if ($block) {
        $path = ICMS_ROOT_PATH.'/modules/'.$dirname.'/templates/blocks/'.$template;
    } else {
Severity: Minor
Found in htdocs/install/modulesadmin.php - About 25 mins 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 extract_post_recursive has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        function extract_post_recursive($key_name, $tmp_array) {
            $table = '';
            $form = '';
            foreach ($tmp_array as $key => $val) {
                if (is_array($val)) {

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

function &xoops_module_gettemplate($dirname, $template, $block = FALSE) {
    global $icmsConfig;
    $ret = '';
    if ($block) {
        $path = ICMS_MODULES_PATH . '/' . $dirname . '/templates/blocks/' . $template;
Severity: Minor
Found in htdocs/modules/system/admin/modulesadmin/modulesadmin.php - About 25 mins 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 getErrors has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        function getErrors($ashtml = true) {
            if ($ashtml) {
                $ret = '';
                foreach ($this->_errors as $msg) {
                    $ret .= "$msg<br />\n";

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

    function query($sql, $limit = 0, $start = 0) {
        $sql4check = substr($sql, 7);
        foreach ($this->doubtful_needles as $needle) {
            if (stristr($sql4check, $needle)) {
                $this->checkSql($sql);

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

    function check_brute_force() {
        $ip4sql = filter_input(INPUT_SERVER, 'REMOTE_ADDR', FILTER_VALIDATE_IP);
        $uri4sql = filter_input(INPUT_SERVER, 'REQUEST_URI', FILTER_SANITIZE_STRING);
        if (empty($ip4sql) || $ip4sql == '') return 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 getIntervalForDisplay has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getIntervalForDisplay() {

        $int = $this->getVar('sat_interval');
        $day = (int) ($int / 60 / 24);
        $hou = (int) (($int - $day * 24 * 60) / 60);
Severity: Minor
Found in htdocs/modules/system/admin/autotasks/class/autotasks.php - About 25 mins 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 getModulesArray has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getModulesArray($full = FALSE) {
        if (!is_array($this->modules_name)) {
            $icms_module_handler = icms::handler('icms_module');
            $installed_modules = $icms_module_handler->getObjects();
            $this->modules_name[0]['name'] = _NONE;
Severity: Minor
Found in htdocs/modules/system/admin/blocksadmin/class/blocksadmin.php - About 25 mins 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 setPage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function setPage($page): string {
        /**
         * If server is PHP 4, display the php4 page and stop the install
         */
        if ($this->no_php5 && $page != 'no_php5') {
Severity: Minor
Found in htdocs/install/class/IcmsInstallWizard.php - About 25 mins 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_check_recursive has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function _bigumbrella_check_recursive($val) {
        if (is_array($val)) {
            foreach ($val as $subval) {
                $this->_bigumbrella_check_recursive($subval);
            }

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

    function isMobile() {
        if (class_exists('Wizin_User')) {
            // WizMobile (gusagi)
            $user = &Wizin_User::getSingleton();
            return $user->bIsMobile;

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

    public function render() {
        $myts = icms_core_Textsanitizer::getInstance();
        if (!$this->content) {
            switch ($this->getVar('customtag_type')) {
                case ICMS_CUSTOMTAG_TYPE_XCODES:
Severity: Minor
Found in htdocs/modules/system/admin/customtag/class/customtag.php - About 25 mins 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 imanager_delfileok has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function imanager_delfileok($image_id, $redir = NULL) {
    global $target, $type;
    if (!icms::$security->check()) {
        redirect_header('browser.php?op=list&target=' . $target . '&type=' . $type, 3, implode('<br />', icms::$security->getErrors()));
    }
Severity: Minor
Found in htdocs/modules/system/admin/images/browser.php - About 25 mins 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 imanager_delfileok has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function imanager_delfileok($image_id, $redir = NULL) {
    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 25 mins 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 editrating has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function editrating($showmenu = FALSE, $ratingid = 0) {
    global $icms_rating_handler, $icmsAdminTpl, $op, $changedField;

    icms_cp_header();

Severity: Minor
Found in htdocs/modules/system/admin/rating/main.php - About 25 mins 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