imagecms/ImageCMS

View on GitHub

Showing 1,858 of 1,858 total issues

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

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

    public function uploadImage() {
        $_POST['maximumSize'] = self::IMAGE_MAX_SIZE;

        if ($this->checkImageUploadErrors()) {
            try {
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 autocomplete has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function autocomplete() {

        if ($this->ajaxRequest) {
            $tokens = [];
            $pages = $this->db->select('title')
Severity: Minor
Found in application/modules/admin/admin_search.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_page_tags has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_page_tags($page_id) {
        $this->db->where('page_id', $page_id);
        $query = $this->db->get('content_tags');

        if (NULL != $query) {
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

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

    public function create_tpl() {
        $file = trim($this->input->post('filename'));

        $this->form_validation->set_rules('filename', lang('Template name', 'admin'), 'required|alpha_numeric|min_length[1]|max_length[250]');

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

    private function isPermitedModules($db_modules, $not_installed) {
        foreach ($db_modules as $key => $db_module) {
            if ($this->isNotPermited($db_module['name'])) {
                unset($db_modules[$key]);
            }
Severity: Minor
Found in application/modules/admin/components.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 _set_page_roles has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function _set_page_roles($page_id, $roles) {

        if ($roles[0] != '') {
            $page_roles = [];

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

    private function checkPaid($param) {
        $ci = &get_instance();

        $order_id = $param['order_id'];
        $userOrder = $ci->db->where('id', $order_id)
Severity: Minor
Found in application/modules/payment_method_liqpay/payment_method_liqpay.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 fromArray has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
    {
        $keys = BannersTableMap::getFieldNames($keyType);

        if (array_key_exists($keys[0], $arr)) {
Severity: Minor
Found in application/modules/xbanners/models/Base/Banners.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 addBannerImageI18n has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function addBannerImageI18n(ChildBannerImageI18n $l)
    {
        if ($l && $locale = $l->getLocale()) {
            $this->setLocale($locale);
            $this->currentTranslations[$locale] = $l;
Severity: Minor
Found in application/modules/xbanners/models/Base/BannerImage.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 buildCriteria has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function buildCriteria()
    {
        $criteria = new Criteria(BannerImageI18nTableMap::DATABASE_NAME);

        if ($this->isColumnModified(BannerImageI18nTableMap::COL_ID)) {
Severity: Minor
Found in application/modules/xbanners/models/Base/BannerImageI18n.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