imagecms/ImageCMS

View on GitHub

Showing 1,388 of 1,858 total issues

Avoid too many return statements within this method.
Open

                    return $this->make(lang('Search', 'navigation'), 'shop/search', $widget);
Severity: Major
Found in application/modules/navigation/navigation_widgets.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

            return $this->errors[] = lang('You did not enter user', 'wishlist');
Severity: Major
Found in application/modules/wishlist/classes/BaseApi.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                return $this->make(lang('Compare', 'navigation'), 'shop/compare', $widget);
Severity: Major
Found in application/modules/navigation/navigation_widgets.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                return false;
Severity: Major
Found in application/modules/CMSFactory/Services/Cache/CacheFactory.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                return $this->template->fetch('widgets/' . $widget['name'], $tpl_data);
Severity: Major
Found in application/modules/navigation/navigation_widgets.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                return $this->make(lang('Wish list', 'navigation'), 'shop/wish_list/', $widget);
Severity: Major
Found in application/modules/navigation/navigation_widgets.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                return $this->make(lang('Wishlist', 'navigation'), 'wishlist', $widget);
Severity: Major
Found in application/modules/navigation/navigation_widgets.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

            return TRUE;
Severity: Major
Found in application/modules/wishlist/classes/ParentWishlist.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                return $this->make(lang('Order details', 'navigation'), 'shop/order/', $widget);
Severity: Major
Found in application/modules/navigation/navigation_widgets.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                return $this->make(lang('Cart', 'navigation'), 'shop/cart/', $widget);
Severity: Major
Found in application/modules/navigation/navigation_widgets.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                    return $this->template->fetch('widgets/' . $widget['name'], $tpl_data);
Severity: Major
Found in application/modules/navigation/navigation_widgets.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                return $this->make(lang('Callbacks', 'navigation'), 'callbacks', $widget);
Severity: Major
Found in application/modules/navigation/navigation_widgets.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                return $this->make(lang('Action type', 'navigation'), 'shop/action_type/show', $widget);
Severity: Major
Found in application/modules/navigation/navigation_widgets.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                return $this->make(lang('Compare', 'navigation'), 'shop/compare/', $widget);
Severity: Major
Found in application/modules/navigation/navigation_widgets.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                return $this->getUrl();
Severity: Major
Found in application/modules/core/models/Base/Route.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

        return $brandId;
Severity: Major
Found in application/modules/exchange/classes/Properties.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                return null;
Severity: Major
Found in application/modules/core/models/Base/Route.php - About 30 mins to fix

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

    private static function checkModuleInstall() {
        $for_check = CI::$APP->uri->segment(2);

        if ($for_check == 'components') {
            if (in_array(CI::$APP->uri->segment(3), ['init_window', 'run', 'cp'])) {
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 _trans has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function _trans($original, $aParams = false) {
        if (!isset($this->gettext_domain)) {
            return false;
        }

Severity: Minor
Found in application/libraries/MY_Lang.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

Severity
Category
Status
Source
Language