imagecms/ImageCMS

View on GitHub
application/modules/navigation/navigation_widgets.php

Summary

Maintainability
D
2 days
Test Coverage

Method widget_navigation has 200 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function widget_navigation($widget = []) {
        $this->load->module('core');

        $segmentGallery = $this->pathGallery();
        if ($this->core->core_data['data_type'] === '404' || !$this->core->core_data['data_type'] || $segmentGallery === 'gallery') {
Severity: Major
Found in application/modules/navigation/navigation_widgets.php - About 1 day to fix

Function widget_navigation has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
Open

    public function widget_navigation($widget = []) {
        $this->load->module('core');

        $segmentGallery = $this->pathGallery();
        if ($this->core->core_data['data_type'] === '404' || !$this->core->core_data['data_type'] || $segmentGallery === 'gallery') {
Severity: Minor
Found in application/modules/navigation/navigation_widgets.php - About 6 hrs 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 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('Feedback', 'navigation'), 'feedback', $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('Profile', 'navigation'), 'shop/profile/', $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('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->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->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->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 $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

There are no issues that match your filters.

Category
Status