Showing 1,388 of 1,858 total issues
Function doInsert
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
protected function doInsert(ConnectionInterface $con)
{
$modifiedColumns = array();
$index = 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 validation
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function validation($postArray, $id = null) {
$typeDiscount = $postArray['type_discount'];
if (!in_array($typeDiscount, ['certificate', 'all_order', 'comulativ', 'user', 'group_user', 'category', 'product', 'brand'])) {
- 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_all_banner
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function get_all_banner($locale, $group = 0, $active = 1) {
$query = $this->db
->select('*, mod_banner.id as id')
->where('locale', $locale);
- 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 not_blocked_url
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function not_blocked_url($url) {
if (!in_array($url, $this->blocked_urls) && !in_array(substr($url, 0, -1), $this->blocked_urls)) {
foreach ($this->blocked_urls as $blocked_url) {
$url = str_replace(site_url(), '', $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
Method doInsert
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function doInsert(ConnectionInterface $con)
{
$modifiedColumns = array();
$index = 0;
- Create a ticketCreate a ticket
Method runProductUpdateQuery
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function runProductUpdateQuery($productId, $arg, $EmptyFields) {
$insertData = [];
if ($arg['url'] != '') {
$arg['url'] = $this->urlCheck($arg['url'], $productId);
- Create a ticketCreate a ticket
Method edit_trash
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function edit_trash($id) {
$query = $this->db->get_where('trash', ['id' => $id]);
$this->template->add_array(['trash' => $query->row()]);
$this->_addShopData();
- Create a ticketCreate a ticket
Permitions
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class Permitions extends BaseAdminController
{
private static $shop_controllers_path; //define shop admin controllers path
- Create a ticketCreate a ticket
Template
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class Template extends Mabilis
{
protected $main_layout = 'main';
- Create a ticketCreate a ticket
ParentWishlist
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class ParentWishlist extends MY_Controller
{
/**
* array that contains wishlist settings
- Create a ticketCreate a ticket
File sitemap_model.php
has 312 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
if (!defined('BASEPATH')) {
exit('No direct script access allowed');
}
- Create a ticketCreate a ticket
File admin_menu_dev.js
has 310 lines of code (exceeds 250 allowed). Consider refactoring. Open
function log(val) {
console.log(val)
}
$(function () {
- Create a ticketCreate a ticket
Method _install
has 86 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 add
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function add() {
$this->form_validation->set_rules('page_title', lang('Title', 'admin'), 'trim|required|min_length[1]|max_length[500]');
$this->form_validation->set_rules('page_url', lang('URL', 'admin'), 'alpha_dash|least_one_symbol|max_length[255]');
$this->form_validation->set_rules('prev_text', lang('Preliminary contents', 'admin'), 'trim|required');
- Create a ticketCreate a ticket
File admin.php
has 310 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
use CMSFactory\assetManager;
use core\models\Route;
use core\models\RouteQuery;
- Create a ticketCreate a ticket
Function checkAllPermitions
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
private static function checkAllPermitions($adminClassName, $adminMethod) {
$ci = &get_instance();
//check if user is loged in
if ($ci->dx_auth->is_logged_in()) {
- 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 backupFiles
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function backupFiles() {
$lockedFiles = $this->getSetting('lockedFiles');
if (!is_array($lockedFiles)) {
$lockedFiles = [];
}
- 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 prepare_tags
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function prepare_tags($array = []) {
$result = [];
if (count($array) > 0) {
$result = $array;
- 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 deleteLanguageFolders
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
private function deleteLanguageFolders($lang) {
$templates_dir = './templates';
$main_dir = './application/language/main';
$modules_dir = './application/modules';
- 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 edit
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function edit($id, $locale = null) {
if (null === $locale) {
$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"