File categories.php
has 548 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
use CMSFactory\Events;
use core\models\Route;
use core\models\RouteQuery;
- Create a ticketCreate a ticket
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
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 create
has a Cognitive Complexity of 26 (exceeds 5 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');
- 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 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
Categories
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class Categories extends BaseAdminController
{
/**
* @var array
- Create a ticketCreate a ticket
Method delete
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function delete() {
foreach ($this->input->post('ids') as $p) {
$cat_id = $p;
- Create a ticketCreate a ticket
Method fast_add
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fast_add($action = '') {
$this->template->add_array(
[
'tree' => $this->lib_category->build(),
- Create a ticketCreate a ticket
Function translate
has a Cognitive Complexity of 16 (exceeds 5 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;
- 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 fast_add
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function fast_add($action = '') {
$this->template->add_array(
[
'tree' => $this->lib_category->build(),
- 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_tpl
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function create_tpl() {
$file = trim($this->input->post('filename'));
$this->form_validation->set_rules('filename', lang('Template name', 'admin'), 'required|alpha_numeric|min_length[1]|max_length[250]');
- Create a ticketCreate a ticket
Function create_tpl
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function create_tpl() {
$file = trim($this->input->post('filename'));
$this->form_validation->set_rules('filename', lang('Template name', 'admin'), 'required|alpha_numeric|min_length[1]|max_length[250]');
- 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"