Showing 1,388 of 1,858 total issues
Function set_meta_tags
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
public function set_meta_tags($title = '', $keywords = '', $description = '', $page_number = '', $showsitename = 0, $category = '') {
if ($this->core_data['data_type'] == 'main') {
$this->template->add_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
File install.php
has 376 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 update
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function update($page_id) {
$pagesPagination = $this->session->userdata('pages_pag_url');
$pagesPagination = $pagesPagination ?: null;
- Create a ticketCreate a ticket
Function delete_all
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
public function delete_all() {
$n = 0;
$cache_store_dir = $this->_Config['store'] . '/';
if (is_dir($cache_store_dir) and ( $root_dir_handle = opendir($cache_store_dir))) {
- 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 delete
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
public function delete() {
foreach ($this->input->post('ids') as $p) {
$cat_id = $p;
- 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 search
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
public function search() {
if ($this->input->get()) {
$locale = MY_Controller::defaultLocale();
@$s_data = $this->input->get('s_data');
@$s_email = $this->input->get('s_email');
- 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 MetaManipulator.php
has 370 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace CMSFactory\MetaManipulator;
use CI;
- Create a ticketCreate a ticket
Method newPost
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function newPost() {
$this->load->model('base');
$this->_init_settings();
($hook = get_hook('comments_on_add')) ? eval($hook) : NULL;
- Create a ticketCreate a ticket
Method moduleInstall
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function moduleInstall() {
$column = $this->db->query("SHOW COLUMNS FROM `shop_orders` where `Field` = 'discount'")->num_rows();
if (!$column) {
$sql = 'ALTER TABLE shop_orders ADD discount float(10,2);';
- Create a ticketCreate a ticket
Method explode_str_on_words
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function explode_str_on_words($text) {
$search = [
"'ё'",
"'<script[^>]*?>.*?</script>'si",
- Create a ticketCreate a ticket
Function register
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
public function register() {
if (!$this->dx_auth->is_logged_in() AND $this->dx_auth->allow_registration) {
$val = $this->form_validation;
// Set form validation rules
$this->form_validation->set_message('required', lang('The %s is required', 'auth'));
- 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 login
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
public function login() {
$this->template->registerMeta('ROBOTS', 'NOINDEX, NOFOLLOW');
$this->core->set_meta_tags(lang('Authorization', 'auth'));
if (!$this->dx_auth->is_logged_in()) {
$val = $this->form_validation;
- 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 create_links
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function create_links() {
// If our item count or per-page total is zero there is no need to continue.
if ($this->total_rows == 0 OR $this->per_page == 0) {
return '';
}
- Create a ticketCreate a ticket
Method create
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function create($action, $cat_id = 0) {
$url = $this->formUrl();
$this->form_validation->set_rules('name', lang('Title', 'admin'), 'trim|required|min_length[1]|max_length[160]|xss_clean');
- Create a ticketCreate a ticket
Function roleCreate
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function roleCreate() {
if ($this->input->post()) {
$this->form_validation->set_rules('Name', lang('Title'), 'required');
$this->form_validation->set_rules('Importance', lang('Важность'), 'numeric');
if ($this->form_validation->run($this) == 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 login
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function login($login, $password, $remember = TRUE) {
// Load Models
$this->ci->load->model('dx_auth/users', 'users');
$this->ci->load->model('dx_auth/user_temp', 'user_temp');
$this->ci->load->model('dx_auth/login_attempts', 'login_attempts');
- 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 31 (exceeds 5 allowed). Consider refactoring. Open
public function edit($page_id, $lang = 0) {
$this->cms_base->setLocaleId($lang);
if ($this->cms_admin->get_page($page_id) == FALSE) {
showMessage(lang('Page', 'admin') . $page_id . lang('Not found', 'admin'), false, '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 applyDiscountCartItems
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
private function applyDiscountCartItems() {
$cart = BaseCart::getInstance();
$cartItems = $cart->getItems('SProducts');
if (count($cartItems['data']) == 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 _buildCategoryMeta
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public static function _buildCategoryMeta($categoryObj) {
CI::$APP->load->helper('array_helper');
$local = 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"
Further reading
Wishlist_model
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
class Wishlist_model extends CI_Model
{
public function __construct() {
parent::__construct();
- Create a ticketCreate a ticket