Function execute
has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring. Open
public function execute($where = [], $offset = 0) {
$collect_ids = FALSE;
if ($this->table == '') {
$error = lang('Error. Select or specify the table for search', 'search');
- 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
File search.php
has 435 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
if (!defined('BASEPATH')) {
exit('No direct script access allowed');
}
- Create a ticketCreate a ticket
Method execute
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute($where = [], $offset = 0) {
$collect_ids = FALSE;
if ($this->table == '') {
$error = lang('Error. Select or specify the table for search', 'search');
- Create a ticketCreate a ticket
Function countSearchResults
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
private function countSearchResults($where) {
// begin query
if (count($where) > 0) {
foreach ($where as $params) {
// Set search operator. (where, like, or_where, etc..)
- 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 index
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function index($hash = '', $offset = 0) {
$this->template->registerMeta('ROBOTS', 'NOINDEX, NOFOLLOW');
$offset = (int) $offset;
- Create a ticketCreate a ticket
Function prepareCategoriesForSearchResults
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
private function prepareCategoriesForSearchResults($foundInCategories) {
$categoriesArray = [];
$categoriesAll = $this->lib_category->unsorted();
foreach ($categoriesAll as $key => $value) {
/** Count of found pages in category * */
- 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 index
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function index($hash = '', $offset = 0) {
$this->template->registerMeta('ROBOTS', 'NOINDEX, NOFOLLOW');
$offset = (int) $offset;
- 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 _install
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _install() {
if ($this->dx_auth->is_admin() == FALSE) {
exit;
}
- Create a ticketCreate a ticket
Method countSearchResults
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function countSearchResults($where) {
// begin query
if (count($where) > 0) {
foreach ($where as $params) {
// Set search operator. (where, like, or_where, etc..)
- Create a ticketCreate a ticket
Method _display
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _display($pages = [], $foundInCategories = null) {
/* * Prepare categories for search results * */
$categoriesInSearchResults = null;
$tree = null;
$categories = [];
- Create a ticketCreate a ticket
Function _display
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function _display($pages = [], $foundInCategories = null) {
/* * Prepare categories for search results * */
$categoriesInSearchResults = null;
$tree = null;
$categories = [];
- 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 init
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function init($config = []) {
foreach ($config as $key => $val) {
if (isset($this->$key)) {
$this->$key = $val;
} else {
- 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 _highlight_text
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function _highlight_text($data, $text) {
if (!$data) {
return;
}
$dataCount = count($data);
- 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"