imagecms/ImageCMS

View on GitHub

Showing 1,388 of 1,858 total issues

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

    public function privilegeEdit($privilegeId) {
        //        $queryRBACPrivilege = $this->db->get_where('shop_rbac_privileges', array('id' => $privilegeId))->row();

        $sqlPr = 'SELECT SRP.id, SRP.name, SRP.group_id, SRPI.title, SRPI.description
            FROM shop_rbac_privileges SRP
Severity: Minor
Found in application/libraries/Permitions.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 loadModules has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function loadModules() {

        CI::$APP->load->helper('file');
        foreach (Modules::$locations as $path => $relPath) {
            $modulesInLocation = get_dir_file_info($path);
Severity: Minor
Found in application/libraries/lib_modules.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 getSetting has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getSetting($key = NULL) {
        $result = $this->ci->db->select('backup')->get('settings');
        if ($result) {
            $row = $result->result_array();
        } else {
Severity: Minor
Found in application/libraries/Backup.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 query_from_file has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function query_from_file($file) {

        $string_query = rtrim($file, "\n;");
        $array_query = explode(";\n", $string_query);

Severity: Minor
Found in application/libraries/Update.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 checkIsInstalled has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function checkIsInstalled() {
        $isNotInstalledInConfig = !config_item('is_installed');
        $installControllerExists = file_exists(getModulePath('install') . '/install.php');

        if (!$isNotInstalledInConfig && !$installControllerExists) {
Severity: Minor
Found in application/libraries/lib_init.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 getWidgetTitle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function getWidgetTitle($name) {
        $ci = &get_instance();

        $locale = MY_Controller::getCurrentLocale();
        $query = $ci->db
Severity: Minor
Found in application/helpers/widget_helper.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 autologin has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function autologin() {
        $result = FALSE;

        //if ($auto = $this->ci->input->cookie($this->ci->config->item('DX_autologin_cookie_name')) AND ! $this->ci->session->userdata('DX_logged_in'))
        if ($auto = $this->ci->input->cookie($this->ci->config->item('DX_autologin_cookie_name'))) {
Severity: Minor
Found in application/libraries/DX_Auth.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 recaptcha_check_answer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function recaptcha_check_answer($privkey, $remoteip, $challenge, $response, $extra_params = []) {

    if ($privkey == null || $privkey == '') {
        die("To use reCAPTCHA you must get an API key from <a href='http://recaptcha.net/api/getkey'>http://recaptcha.net/api/getkey</a>");
    }
Severity: Minor
Found in application/helpers/recaptcha_helper.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 prepareConditions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function prepareConditions(array $params) {

        $paidCondition = '';
        if (isset($params['paid'])) {
            switch ($params['paid']) {
Severity: Minor
Found in application/modules/mod_stats/models/orders_model.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 _get_sub_cats has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function _get_sub_cats($parent_id) {
        $new_sub_cats = [];
        $this->level++;

        foreach ($this->categories as $sub_cats) {
Severity: Minor
Found in application/libraries/lib_category.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 getMoFileName has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function getMoFileName($domain) {

        if ($domain) {
            if (array_key_exists('MO_FILE_NAMES', $GLOBALS) && array_key_exists($domain, $GLOBALS['MO_FILE_NAMES'])) {
                return $GLOBALS['MO_FILE_NAMES'][$domain];
Severity: Minor
Found in application/helpers/language_helper.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 renderGA has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function renderGA($GAid = null) {

        /* Show Google Analytics code if some value inserted in admin panel */
        if ($GAid['google_analytics_id']) {
            if ($this->getCustomParams()) {
Severity: Minor
Found in application/libraries/lib_seo.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 getCategoriesPaths has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getCategoriesPaths() {
        $categoriesPathes = [];
        foreach ($this->categoriesData as $id => $data) {
            if (is_array($data['full_path_ids']) & $data['full_path_ids'] !== FALSE) {
                $pathNames = [];
Severity: Minor
Found in application/modules/import_export/classes/Export.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 autoload has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function autoload() {
        /** Check setting 'save_search_result' * */
        if ($this->stats_model->getSettingByName('save_search_results_ac') == '1') {
            //Autocomplete results
            Events::create()->onShopSearchAC()->setListener('saveSearchedKeyWordsAC');
Severity: Minor
Found in application/modules/mod_stats/mod_stats.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 setVoutesAfterDelete has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function setVoutesAfterDelete() {

        foreach ($this->comments_product_id as $item) {

            $query = $this->db->select('SUM(rate) AS rate , COUNT(rate) AS votes')
Severity: Minor
Found in application/modules/comments/models/base.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 getLastViewedPage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getLastViewedPage() {
        $locale = MY_Controller::getCurrentLocale();

        $query
                = "
Severity: Minor
Found in application/modules/mod_stats/models/custom_model.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 getTotalCommentsForProducts has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getTotalCommentsForProducts($ids, $module = 'shop', $status = 0) {
        if ($ids == null || !$this->db->table_exists('comments')) {
            return;
        }

Severity: Minor
Found in application/modules/comments/commentsapi.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 Querys has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function Querys() {

        foreach ($this->input->post('data') as $query) {
            if ($query) {
                if (!$this->db->query($query)) {
Severity: Minor
Found in application/modules/admin/sys_update.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 saveImage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function saveImage($imageId = NULL, $locale = NULL) {

        if (!file_exists(self::IMAGES_ORIGIN_DIR_PATH)) {
            $this->buildImagePath(self::IMAGES_ORIGIN_DIR_PATH);
        }
Severity: Minor
Found in application/modules/xbanners/src/Managers/ImagesManager.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 initialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function initialize($config = []) {
        if (count($config) > 0) {
            foreach ($config as $k => $v) {
                if (isset($this->$k)) {
                    $this->$k = $v;
Severity: Minor
Found in application/modules/tags/tags.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