Function recent_news
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function recent_news($widget = []) {
if ($widget['settings'] == FALSE) {
$settings = $this->defaults;
} else {
$settings = $widget['settings'];
- 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
Method recent_news
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function recent_news($widget = []) {
if ($widget['settings'] == FALSE) {
$settings = $this->defaults;
} else {
$settings = $widget['settings'];
- Create a ticketCreate a ticket
Method recent_news_configure
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function recent_news_configure($action = 'show_settings', $widget_data = []) {
if ($this->dx_auth->is_admin() == FALSE) {
exit;
}
- Create a ticketCreate a ticket
Method similar_posts_configure
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function similar_posts_configure($action = 'show_settings', $widget_data = []) {
if ($this->dx_auth->is_admin() == FALSE) {
exit;
}
$this->load->library('similar_posts', null, 'similar_library');
- Create a ticketCreate a ticket
Function recent_news_configure
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function recent_news_configure($action = 'show_settings', $widget_data = []) {
if ($this->dx_auth->is_admin() == FALSE) {
exit;
}
- 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
Function similar_posts_configure
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function similar_posts_configure($action = 'show_settings', $widget_data = []) {
if ($this->dx_auth->is_admin() == FALSE) {
exit;
}
$this->load->library('similar_posts', null, 'similar_library');
- 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"