Showing 1,388 of 1,858 total issues
Admin
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class Admin extends BaseAdminController
{
private static $BILING;
- Create a ticketCreate a ticket
Method roleEdit
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function roleEdit($roleId) {
$locale = MY_Controller::getCurrentLocale();
$queryModel = $this->db->select('shop_rbac_roles.id, shop_rbac_roles.name , shop_rbac_roles.importance, shop_rbac_roles_i18n.alt_name, shop_rbac_roles_i18n.description ')
- Create a ticketCreate a ticket
Method getOnline
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getOnline() {
$locale = MY_Controller::getCurrentLocale();
$query = "
SELECT
`mod_stats_attendance`.`id_user`,
- Create a ticketCreate a ticket
File cmsemail_model.php
has 297 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
use CMSFactory\ModuleSettings;
/**
* @property CI_DB_active_record $db
- Create a ticketCreate a ticket
Method translate
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function translate($id, $lang) {
$cat = $this->cms_admin->get_category($id);
($hook = get_hook('admin_on_translate_cat')) ? eval($hook) : NULL;
- Create a ticketCreate a ticket
Function processRbacPrivileges
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
private static function processRbacPrivileges() {
$ci = &get_instance();
$controllerFolders = self::$controller_types;
foreach ($controllerFolders as $folder) {
if ($folder == 'base') {
- 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_templates
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
function get_templates() {
$new_arr_shop = [];
if ($handle = opendir(TEMPLATES_PATH)) {
while (false !== ($file = readdir($handle))) {
- 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 renderGAForCart
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function renderGAForCart($model = null, $GAid = null) {
/* Show Google Analytics code if some value inserted in admin panel */
if ($GAid['google_analytics_id']) {
if ($this->getCustomParams()) {
- 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 siteInfoAdditionalManipulations
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
function siteInfoAdditionalManipulations($name) {
if (FALSE !== strpos($name, '_path')) {
$name = str_replace('_path', '', $name);
}
if (FALSE !== strpos($name, '_url')) {
- 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 parseFile
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function parseFile($offers, $limit, $file = false) {
if (!$file) {
$file = @fopen($this->CSVsource, 'r');
}
if ($offers > 0) {
- 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 updateSProductsCategories
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
private function updateSProductsCategories(&$arg, $productId, $EmptyFields) {
$shopCategoryIds = [];
$updateAddCategories = isset($arg['addcats']) && ('' !== trim($arg['addcats']) || $EmptyFields);
if ($updateAddCategories) {
- 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 settings
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function settings($action = 'show') {
switch ($action) {
case 'show':
\CMSFactory\assetManager::create()
- 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 connect_fields
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function connect_fields($item_data, $item_type) {
if (($cache_result = $this->cache->fetch('cfcm_field_' . $item_data['id'] . $item_type)) !== false) {
$item_data = array_merge($item_data, $cache_result);
return $item_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"
Further reading
Function get_form
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function get_form($category_id = false, $item_id = false, $item_type = false, $tpl = '_onpage_form') {
if ('page' === $category_id) {
$item_type = 'page';
$item_id = 0;
- 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 save_item_data
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function save_item_data($item_id, $type = 'page') {
$this->load->module('forms');
$group = (int) $this->input->post('cfcm_use_group');
- 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 copyUploads
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
private function copyUploads($templateName) {
$templateUploadsFolder = "./templates/{$templateName}/uploads";
if (is_dir($templateUploadsFolder)) {
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($templateUploadsFolder)) as $entity) {
- 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 prepareUpdateSettings
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function prepareUpdateSettings($data) {
if (!isset($data['Project-Id-Version']) || !$data['Project-Id-Version']) {
$data['projectName'] = '';
} else {
$data['projectName'] = $data['Project-Id-Version'];
- 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 update
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function update($name, $type, $lang, $data) {
$po_data = $this->toArray($name, $type, $lang);
if ($po_data && array_key_exists('po_array', $po_data)) {
foreach ($data as $origin => $values) {
- 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 saveCustomData
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function saveCustomData() {
$locale = in_array($this->entityName, $this->entities_locale, true) ? chose_language() : MY_Controller::defaultLocale();
if ($this->hasCustomData === false) {
- 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 sendEmail
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function sendEmail($send_to, $pattern_name, $variables, $attachment = FALSE) {
//loading CodeIgniter Email library
$this->load->library('email');
$locale = MY_Controller::getCurrentLocale();
- 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"