imagecms/ImageCMS

View on GitHub

Showing 1,388 of 1,858 total issues

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

    public function get_group_fields($group_id = -1) {

        // Get all fields in group
        $query = $this->db
            ->where('group_id', $group_id)
Severity: Minor
Found in application/modules/cfcm/cfcm.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 exchangeTranslation has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function exchangeTranslation($data) {
        $langExchanger = $data['langExchanger'];
        $langReceiver = $data['langReceiver'];

        $typeExchanger = $data['typeExchanger'];
Severity: Minor
Found in application/modules/translator/classes/PoFileManager.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 add has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function add() {
        if (!in_array($this->name, $this->components)) {
            if (file_exists(BASEPATH . '../application/modules/' . $this->name . '/' . $this->name . '.php')) {
                include_once BASEPATH . '../application/modules/' . $this->name . '/' . $this->name . '.php';

Severity: Minor
Found in application/modules/template_manager/installer/ModuleDependence.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 getColorSchemes_ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function getColorSchemes_() {
        if (is_null($this->templateName)) {
            return;
        }

Severity: Minor
Found in application/modules/template_manager/classes/TArchive.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 render has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function render($id = 0, $group = 0) {
        if ($this->no_install === false) {
            return false;
        }
        $type = $this->core->core_data['data_type'];
Severity: Minor
Found in application/modules/banners/banners.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 prepareDomain has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function prepareDomain($domain) {
        $CI = &get_instance();
        $template = $CI->config->item('template');

        if ($template != 'administrator') {
Severity: Minor
Found in application/modules/translator/classes/PoFileManager.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 save has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function save($name, $type, $lang, $data) {
        ksort($data, SORT_STRING | SORT_FLAG_CASE);

        $url = $this->getPoFileUrl($name, $type, $lang);

Severity: Minor
Found in application/modules/translator/classes/PoFileManager.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 filterSettings has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function filterSettings($query) {
        if (1 !== preg_match('/insert\s+into\s+\`settings\`/i', trim($query))) {
            return false;
        }

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

    private function checkActivity($categories) {
        $activeCategories = [];
        foreach ($categories as $category) {
            if (!in_array((int) $category['id'], $activeCategories)) {
                array_push($activeCategories, (int) $category['id']);
Severity: Minor
Found in application/modules/sitemap/models/sitemap_model.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 getShopBrands has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function getShopBrands() {

        // Get Shop Brands
        $shop_brands = $this->sitemap_model->get_shop_brands();

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

    private function filesChange($origin, $new_origin, $template_name) {
        $dir = './templates/' . $template_name;
        $baseDir = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir));
        foreach ($baseDir as $file) {
            if ($file->isFile()) {
Severity: Minor
Found in application/modules/translator/classes/Replacer.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 prepareFile has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function prepareFile($po_file, $isOrigin = TRUE) {
        if ($po_file['po_array']) {
            $counter = 0;
            foreach ($po_file['po_array'] as $origin => $lang) {
                $lang['translation'] = $lang['translation'] ? $lang['translation'] : YandexTranslate::getInstatce()->translate('ru', $origin, 'en');
Severity: Minor
Found in application/modules/translator/classes/Replacer.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 build_xml_map has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function build_xml_map($regenerate = FALSE) {

        $settings = $this->sitemap_model->load_settings();

        // Generate new or use saved map
Severity: Minor
Found in application/modules/sitemap/sitemap.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 registerStyle has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function registerStyle($name, $useCompress = FALSE) {
        /** Start. Load file into template */

        $path = $this->buildStylePath($name);
        if ('' !== $path) {
Severity: Minor
Found in application/modules/CMSFactory/assetManager.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 checkOrder has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function checkOrder($callbackParams, $sendCode = FALSE, $aviso = FALSE) {

        if ($this->checkSign($callbackParams)) {
            $code = 0;
        } else {
Severity: Minor
Found in application/modules/payment_method_yakassa/payment_method_yakassa.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 setDefaultStatus has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function setDefaultStatus() {
        if ($this->input->post('id') && is_numeric($this->input->post('id'))) {
            $model = SCallbackStatusesQuery::create()->setComment(__METHOD__)->findPk($this->input->post('id'));
            if ($model) {
                if ($model->getIsDefault() == FALSE) {
Severity: Minor
Found in application/modules/callbacks/admin.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 checkPaid has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function checkPaid($param) {
        $ci = &get_instance();
        $key = $param['paymentKey'];
        $paySettings = $this->getPaymentSettings($key);
        $param['shopid'] = $paySettings['shopid'];
Severity: Minor
Found in application/modules/payment_method_yakassa/payment_method_yakassa.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 _check_roles has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function _check_roles($roles = []) {
        $access = FALSE;

        foreach ($roles as $role_id) {
            $my_role = $this->dx_auth->get_role_id();
Severity: Minor
Found in application/modules/menu/menu.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 makePath has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function makePath($path) {
        $path = str_replace(['/', '\\'], DIRECTORY_SEPARATOR, $path);
        $parts = array_filter(explode(DIRECTORY_SEPARATOR, $path), 'strlen');
        $startSlash = strpos($path, '/') === 0 ? '/' : '';

Severity: Minor
Found in application/modules/CMSFactory/assetManager.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

    public function __construct(ObjectCollection $items, $rootId = 0) {

        foreach ($items as $item) {

            $this->data[$item->getId()] = new ModelWrapper($item);
Severity: Minor
Found in application/modules/CMSFactory/Tree/TreeCollection.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

Severity
Category
Status
Source
Language