imagecms/ImageCMS

View on GitHub

Showing 1,388 of 1,858 total issues

Function _detect_uri has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function _detect_uri() {
        if (!$this->CI->input->server('REQUEST_URI')) {
            return '';
        }

Severity: Minor
Found in application/libraries/lib_init.php - About 45 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 forgot_password has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function forgot_password($login) {
        // Default return value
        $result = FALSE;

        if ($login) {
Severity: Minor
Found in application/libraries/DX_Auth.php - About 45 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 deeply nested control flow statements.
Open

                        while (FALSE !== ($fileT = readdir($sub_dir_handle))) {

                            if ($fileT != '.' && $fileT != '..' && $fileT != '/') {

                                $n++;
Severity: Major
Found in application/libraries/cache.php - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                        while (false !== ($fileT = readdir($sub_dir_handle))) {

                            if ($fileT != '.' && $fileT != '..' && $fileT != '/' && strstr($fileT, '~') != TRUE) {
                                $n++;
                            }
Severity: Major
Found in application/libraries/cache.php - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                        if (!empty($searched)) {
                            $filePath = array_pop($searched);
                        }
Severity: Major
Found in application/helpers/language_helper.php - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                        if ($fileT != '.' && $fileT != '..' && $fileT != '/' && (time() - @$stat['mtime']) > $this->_Config['auto_clean_life']) {
                            @unlink('./system/cache/' . $file . '/' . $fileT);
                            $n++;
                        }
Severity: Major
Found in application/libraries/cache.php - About 45 mins to fix

Function category_pages has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    function category_pages($categoryId, $limit = 0) {
        $ci = &get_instance();

        $category = $ci->lib_category->get_category($categoryId);
        $category['fetch_pages'] = unserialize($category['fetch_pages']);
Severity: Minor
Found in application/helpers/page_helper.php - About 45 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 form_property_select has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    function form_property_select($name, $data, $selected, $multiple) {
        $selected = !is_array($selected) ? [$selected] : $selected;
        $multiple = $multiple === 'multiple' ? 'multiple="multiple"' : '';
        $result = "<select name='$name' $multiple>";

Severity: Minor
Found in application/helpers/html_helper.php - About 45 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 siteinfo has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    function siteinfo($name = NULL) {

        // for shorter notation...
        if (0 !== strpos($name, 'siteinfo_')) {
            $name = 'siteinfo_' . $name;
Severity: Minor
Found in application/helpers/siteinfo_helper.php - About 45 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 deeply nested control flow statements.
Open

                        if (!empty($searched)) {
                            $filePath = array_pop($searched);
                        }
Severity: Major
Found in application/helpers/language_helper.php - About 45 mins to fix

Function getCategoriesAttendanceData has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function getCategoriesAttendanceData() {
        $this->controller->import('traits/DateIntervalTrait.php');
        $this->controller->load->model('attendance_model');

        $this->controller->load->model('categories_model');
Severity: Minor
Found in application/modules/mod_stats/controllers/CategoriesController.php - About 45 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 getDataCsv has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDataCsv() {
        if (!$this->resultString) {
            $fileContents = '';
            $someProductData = current($this->resultArray);
            $headerArray = [];
Severity: Minor
Found in application/modules/import_export/classes/Export.php - About 45 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 getComments has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function getComments($url) {
        $this->load->model('base');
        $this->_init_settings();
        $this->module = $this->getModule($url);
        $item_id = $this->parsUrl($url);
Severity: Minor
Found in application/modules/comments/commentsapi.php - About 45 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 check_comment_period has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    protected function check_comment_period() {

        ($hook = get_hook('comments_on_check_period')) ? eval($hook) : NULL;

        if ($this->dx_auth->is_admin() == TRUE) {
Severity: Minor
Found in application/modules/comments/comments.php - About 45 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 getCompleteFields has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getCompleteFields() {
        $abbreviations = $this->getAbbreviation();
        $completeFields = [];

        //a reduction of the field names and field attributes
Severity: Minor
Found in application/modules/import_export/classes/Export.php - About 45 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 page_tags has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    function page_tags($page_id = 0) {

        $ci = & get_instance();

        $ci->db->select('tag_id');
Severity: Minor
Found in application/modules/tags/helpers/tags_helper.php - About 45 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 deeply nested control flow statements.
Open

                        if ($page_roles[$i2]['role_id'] == '0') {
                            $this->template->assign('all_selected', 'selected="true"');
                        }
Severity: Major
Found in application/modules/admin/pages.php - About 45 mins to fix

Function index has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function index() {
        if ($this->dx_auth->is_max_login_attempts_exceeded()) {

            $this->dx_auth->captcha();
            $this->template->assign('use_captcha', '1');
Severity: Minor
Found in application/modules/admin/login.php - About 45 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 deeply nested control flow statements.
Open

                        if ($page_roles[$i2]['role_id'] == $roles[$i]['id']) {
                            $roles[$i]['selected'] = 'selected="true"';
                        }
Severity: Major
Found in application/modules/admin/pages.php - About 45 mins to fix

Function doDelete has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

     public static function doDelete($values, ConnectionInterface $con = null)
     {
        if (null === $con) {
            $con = Propel::getServiceContainer()->getWriteConnection(BannersTableMap::DATABASE_NAME);
        }
Severity: Minor
Found in application/modules/xbanners/models/Map/BannersTableMap.php - About 45 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