Showing 1,858 of 1,858 total issues
Function index
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function index() {
$this->init();
$status = $this->uri->segment(7);
$off_set = $this->uri->segment(8);
- 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 applyResultDiscount
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function applyResultDiscount() {
BaseDiscount::prepareOption(['reBuild' => 1]);
$this->baseDiscount = BaseDiscount::create();
if (BaseDiscount::checkModuleInstall()) {
- 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 renderModulesNames
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function renderModulesNames($lang) {
$langs = $this->session->userdata('langs_modules');
$langs = $langs[$lang];
$langs = sort_names($langs);
- 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 getData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getData() {
$data = [];
foreach ($this->fields as $key => $val) {
if (isset($this->$key) AND method_exists($this->$key, 'getData')) {
- 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 savePoArray
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function savePoArray($module_template, $type, $lang) {
$po_array = (array) json_decode($this->input->post('po_array'));
$showMessage = (bool) $this->input->post('showMessage');
- 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 setAttributes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function setAttributes($data = []) {
if (count($data) > 0 AND $data != FALSE) {
foreach ($data as $key => $val) {
if (isset($this->$key) AND method_exists($this->$key, 'setAttributes')) {
- 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 query_from_file
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function query_from_file($sqlString) {
$allowedTables = \CI::$APP->load
->module('template_manager')
->config
- 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 add
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function add($pathArray, $isDir, &$tree) {
$firstElement = array_shift($pathArray);
if (count($pathArray) > 0) {
if (!isset($tree[$firstElement])) {
$tree[$firstElement] = [];
- 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 get_main_lang
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function get_main_lang($flag = null) {
$lang = $this->db->get('languages')->result_array();
$lan_array = [];
foreach ($lang as $l) {
- 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 prepareData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function prepareData(\SimpleXMLElement $level) {
if (strstr($level->getName(), 'level_')) {
$attributes = $level->attributes();
$level_number = (int) str_replace('level_', '', $level->getName());
if (isset($this->categories_levels[$level_number])) {
- 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 searchPoFileAutocomplete
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function searchPoFileAutocomplete($name, $type, $lang, $searchString) {
$poFile = $this->toArray($name, $type, $lang);
$poFileData = $poFile['po_array'];
$searchString = mb_strtolower(trim($searchString));
- 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 savePoMo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static function savePoMo($saveDomain) {
foreach (self::$domainTranslations as $domain => $langs) {
if ($domain == $saveDomain) {
foreach ($langs as $lang => $translation) {
- 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 copyFolder
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function copyFolder($template_name, $source = '', $dest = '') {
$source = $source ? $source : './templates/' . $template_name;
if (!$dest) {
$dest = $source . '_backup_' . time();
- 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 _create_map
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function _create_map() {
if ($this->robotsCheck()) {
$this->initialize();
- 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 renderUserWLEdit
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function renderUserWLEdit($wish_list_id, $userID = null) {
if ($userID === null) {
$userID = $this->dx_auth->get_user_id();
}
- 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 error_log
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function error_log($error, $send_email = false) {
$intIp = $_SERVER['REMOTE_ADDR'];
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
if (isset($_SERVER['HTTP_X_REAL_IP'])) {
- 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 getUserWishListsByID
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getUserWishListsByID($user_id, $access = ['public', 'shared', 'private']) {
$locale = \MY_Controller::getCurrentLocale();
$queryFirst = $this->db
->select('*, shop_product_variants.mainImage AS `image`, mod_wish_list_products.id AS list_product_id, route.url, route.parent_url')
->where('mod_wish_list.user_id', $user_id)
- 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 create_menu
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function create_menu() {
//cp_check_perm('menu_create');
if ($this->input->post('menu_name') == NULL) {
showMessage(lang('Name field sieve', 'menu'), '', 'r');
- 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 display_selector
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function display_selector($id, $type = 'page') {
$this->template->assign('insert_id', $id);
$this->menu->prepare_menu_array($this->get_name_by_id($id));
- 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 toCurrency
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function toCurrency($attributeName = 'Price', $cId = null, $convertForTemplate = false) {
$attributeName = strtolower($attributeName);
$get = 'get' . $attributeName;
if (!$convertForTemplate) {
- 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"