application/modules/admin/settings.php
File settings.php
has 354 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
use template_manager\classes\Template;
if (!defined('BASEPATH')) {
- Create a ticketCreate a ticket
Method index
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function index() {
$settings = $this->cms_admin->get_settings();
unset($settings['siteinfo']);
- Create a ticketCreate a ticket
Method save
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function save() {
//cp_check_perm('cp_site_settings');
$this->form_validation->set_rules('siteinfo_adminemail', lang('Admin email', 'admin'), 'trim|valid_email');
if (!$this->form_validation->run($this)) {
- Create a ticketCreate a ticket
Function processSiteInfo
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
Open
protected function processSiteInfo() {
$this->load->library('SiteInfo', $this->input->post('siteinfo_locale'));
// getting all parameters with keys
- 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 processSiteInfo
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function processSiteInfo() {
$this->load->library('SiteInfo', $this->input->post('siteinfo_locale'));
// getting all parameters with keys
- Create a ticketCreate a ticket
Method translate_meta
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function translate_meta() {
$this->load->library('form_validation');
$this->form_validation->set_rules('name', lang('Name', 'admin'), 'trim|required|xss_clean');
- Create a ticketCreate a ticket
Function save
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
public function save() {
//cp_check_perm('cp_site_settings');
$this->form_validation->set_rules('siteinfo_adminemail', lang('Admin email', 'admin'), 'trim|valid_email');
if (!$this->form_validation->run($this)) {
- 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"