File admin.php
has 821 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 resize_and_thumb
has 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function resize_and_thumb($file = []) {
$this->load->library('image_lib');
// Resize image
if ($this->conf['max_width'] > 0 AND $this->conf['max_height'] > 0) {
- Create a ticketCreate a ticket
Method settings
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function settings($action = 'show') {
switch ($action) {
case 'show':
\CMSFactory\assetManager::create()
- Create a ticketCreate a ticket
Function resize_and_thumb
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
private function resize_and_thumb($file = []) {
$this->load->library('image_lib');
// Resize image
if ($this->conf['max_width'] > 0 AND $this->conf['max_height'] > 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
Admin
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
class Admin extends BaseAdminController
{
// Gallery config
public $conf = [
- Create a ticketCreate a ticket
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 upload_image
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function upload_image($album_id = 0) {
$temp_conf = $this->conf;
if (is_array($_FILES['newPic'])) {
if (count($_FILES['newPic']['name']) > ini_get('max_file_uploads')) {
- 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 upload_image
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function upload_image($album_id = 0) {
$temp_conf = $this->conf;
if (is_array($_FILES['newPic'])) {
if (count($_FILES['newPic']['name']) > ini_get('max_file_uploads')) {
- Create a ticketCreate a ticket
Method update_album
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function update_album($id, $locale) {
$this->form_validation->set_rules('name', lang('Name', 'gallery'), 'required');
$tpl_file = $this->input->post('tpl_file');
if (!preg_match('/[a-z]/', $tpl_file) && !empty($tpl_file)) {
showMessage('wrong tpl name', '', 'r');
- Create a ticketCreate a ticket
Function category
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function category($id) {
$albums = $this->gallery_m->get_albums('position', 'asc', $id);
if ($albums != FALSE) {
$cnt = count($albums);
- 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 update_category
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function update_category($id, $locale) {
$this->load->library('Form_validation');
$val = $this->form_validation;
$val->set_rules('name', lang('Name', 'gallery'), 'trim|required|max_length[250]|min_length[1]');
- Create a ticketCreate a ticket
Method add_image
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function add_image($album_id = 0, $file_data = []) {
$this->load->helper('number');
$size = $this->get_image_size($file_data['full_path']);
- Create a ticketCreate a ticket
Method category
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function category($id) {
$albums = $this->gallery_m->get_albums('position', 'asc', $id);
if ($albums != FALSE) {
$cnt = count($albums);
- Create a ticketCreate a ticket
Method create_category
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function create_category() {
$locale = $this->gallery_m->chose_locale();
$this->load->library('Form_validation');
- Create a ticketCreate a ticket
Function update_category
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function update_category($id, $locale) {
$this->load->library('Form_validation');
$val = $this->form_validation;
$val->set_rules('name', lang('Name', 'gallery'), 'trim|required|max_length[250]|min_length[1]');
- 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_album
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function update_album($id, $locale) {
$this->form_validation->set_rules('name', lang('Name', 'gallery'), 'required');
$tpl_file = $this->input->post('tpl_file');
if (!preg_match('/[a-z]/', $tpl_file) && !empty($tpl_file)) {
showMessage('wrong tpl name', '', '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 update_info
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function update_info($id, $locale = null) {
if (null === $locale) {
$locale = $this->gallery_m->chose_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 create_album
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function create_album() {
$this->load->library('Form_validation');
$this->form_validation->set_rules('name', lang('Name', 'gallery'), 'required|min_length[3]|max_length[250]');
$this->form_validation->set_rules('email', lang('Description', 'gallery'), 'max_length[500]');
- 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_category
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function delete_category() {
foreach ($this->input->post('id') as $id) {
// Delete category albums
$albums = $this->gallery_m->get_albums('date', 'desc', $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"