ImpressCMS/impresscms

View on GitHub

Showing 540 of 47,256 total issues

Function cleaning_write_folders has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    function cleaning_write_folders() {
        $dir = array();
        $dir['templates_c'] = ICMS_COMPILE_PATH . "/";
        $dir['cache'] = ICMS_CACHE_PATH . "/";

Severity: Minor
Found in upgrade/upd-2.0.18-to-impresscms-1.0/index.php - About 35 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 gregorian_to_jalali has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function gregorian_to_jalali($g_y, $g_m, $g_d) {
    $g_days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
    $j_days_in_month = array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);

    $gy = $g_y-1600;
Severity: Minor
Found in htdocs/include/jalali.php - About 35 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_sanitizeContentCss has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function icms_sanitizeContentCss($text) {
    if (preg_match_all('/(.*?)\{(.*?)\}/i', $text, $css)) {
        $css = $css[0];
        $perm = $not_perm = array();
        foreach($css as $k=>$v) {
Severity: Minor
Found in htdocs/include/functions.php - About 35 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 admin_refcheck has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    function admin_refcheck($chkref = "") {
        if (empty($_SERVER['HTTP_REFERER'])) {
            return true;
        } else {
            $ref = $_SERVER['HTTP_REFERER'];

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

    public function getCustomtagsByName() {
        if (!$this->_objects) {
            global $icmsConfig;

            $ret = array();
Severity: Minor
Found in htdocs/modules/system/admin/customtag/class/customtag.php - About 35 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 __construct has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    function __construct($post=false) {

        $this->sanitizer =& icms_core_Textsanitizer::getInstance();
        if ($post) {
            $this->readPost();
Severity: Minor
Found in htdocs/install/class/settingmanager.php - About 35 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 issue has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        function issue($salt = '', $timeout = 1800, $area = '') {
            global $xoopsModule;

            // create a token
            list($usec, $sec) = explode(" ", microtime());

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

    function replace_doubtful($key, $val) {
        $index_expression = '';
        $indexes = explode('_', $key);
        $base_array = array_shift($indexes);

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 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getModulesArray($full = false) {
        if (!is_array($this->modules_name) || !count($this->modules_name)) {
            $icms_module_handler = icms::handler('icms_module');
            $installed_modules = &$icms_module_handler->getObjects();
            foreach ($installed_modules as $module) {
Severity: Minor
Found in htdocs/modules/system/admin/pages/class/pages.php - About 35 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 b_system_social_show has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function b_system_social_show($options) {
    $block = array();
    $block['provider'] = array();

    $i = 0;
Severity: Minor
Found in htdocs/modules/system/blocks/system_blocks.php - About 35 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

Avoid too many return statements within this function.
Open

                            return results;
Severity: Major
Found in htdocs/install/prototype.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return false;
    Severity: Major
    Found in htdocs/install/prototype.js - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                      return false;
      Severity: Major
      Found in upgrade/upd-icms-1.0-to-1.1/index.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return false;
        Severity: Major
        Found in upgrade/upd-icms-1.0-to-1.1/index.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                          return false;
          Severity: Major
          Found in upgrade/upd-icms-1.0-to-1.1/index.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                            return false;
            Severity: Major
            Found in upgrade/upd-icms-1.0-to-1.1/index.php - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return value;
              Severity: Major
              Found in htdocs/install/prototype.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                    return results;
                Severity: Major
                Found in htdocs/install/prototype.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                  return compare & 4 ? -1 : 1;
                  Severity: Major
                  Found in htdocs/install/prototype.js - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return false;
                    Severity: Major
                    Found in upgrade/upd-icms-1.0-to-1.1/index.php - About 30 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language