application/modules/navigation/navigation_widgets.php
Method widget_navigation
has 200 lines of code (exceeds 25 allowed). Consider refactoring. Open
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') {
- Create a ticketCreate a ticket
Function widget_navigation
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
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') {
- Read upRead up
- Create a ticketCreate a ticket
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
Open
return $this->template->fetch('widgets/' . $widget['name'], $tpl_data);
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
Open
return $this->make(lang('Feedback', 'navigation'), 'feedback', $widget);
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
Open
return $this->template->fetch('widgets/' . $widget['name'], $tpl_data);
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
Open
return $this->make(lang('Profile', 'navigation'), 'shop/profile/', $widget);
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
Open
return $this->make(lang('Search', 'navigation'), 'shop/search/', $widget);
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
Open
return $this->make(lang('Search', 'navigation'), 'shop/search', $widget);
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
Open
return $this->make(lang('Compare', 'navigation'), 'shop/compare', $widget);
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
Open
return $this->template->fetch('widgets/' . $widget['name'], $tpl_data);
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
Open
return $this->make(lang('Wish list', 'navigation'), 'shop/wish_list/', $widget);
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
Open
return $this->make(lang('Wishlist', 'navigation'), 'wishlist', $widget);
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
Open
return $this->make(lang('Order details', 'navigation'), 'shop/order/', $widget);
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
Open
return $this->make(lang('Cart', 'navigation'), 'shop/cart/', $widget);
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
Open
return $this->template->fetch('widgets/' . $widget['name'], $tpl_data);
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
Open
return $this->make(lang('Callbacks', 'navigation'), 'callbacks', $widget);
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
Open
return $this->make(lang('Action type', 'navigation'), 'shop/action_type/show', $widget);
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
Open
return $this->make(lang('Compare', 'navigation'), 'shop/compare/', $widget);
- Create a ticketCreate a ticket