Function create_field
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
public function create_field() {
$form = $this->get_form('create_field');
$form->action = $this->get_url('create_field');
$form->title = lang('Field creating', 'cfcm');
- 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 admin.php
has 338 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
if (!defined('BASEPATH')) {
exit('No direct script access allowed');
}
- Create a ticketCreate a ticket
Function edit_field
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
public function edit_field($name = '') {
$name = urldecode($name);
$this->db->limit(1);
$field = $this->db->get_where('content_fields', ['field_name' => (string) $name]);
- 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 edit_field
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function edit_field($name = '') {
$name = urldecode($name);
$this->db->limit(1);
$field = $this->db->get_where('content_fields', ['field_name' => (string) $name]);
- Create a ticketCreate a ticket
Method create_field
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function create_field() {
$form = $this->get_form('create_field');
$form->action = $this->get_url('create_field');
$form->title = lang('Field creating', 'cfcm');
- Create a ticketCreate a ticket
Function getFormFields
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function getFormFields($type = NULL) {
if ($type) {
$form = $this->load->module('cfcm/cfcm_forms')->edit_field($type);
- 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 edit_group
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function edit_group($id) {
$id = (int) $id;
$group = $this->db->get_where('content_field_groups', ['id' => $id]);
- Create a ticketCreate a ticket
Method edit_field_data_type
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function edit_field_data_type($field_name) {
$form = $this->get_form('create_field');
$form->action = $this->get_url('edit_field_data_type/' . $field_name);
$form->title = lang('Field editing', 'cfcm');
- Create a ticketCreate a ticket
Method create_group
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function create_group() {
$form = $this->get_form('create_group_form');
$form->action = $this->get_url('create_group');
$form->title = lang('Creating a group', 'cfcm');
$form->type = 'group';
- Create a ticketCreate a ticket
Function create_group
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function create_group() {
$form = $this->get_form('create_group_form');
$form->action = $this->get_url('create_group');
$form->title = lang('Creating a group', 'cfcm');
$form->type = 'group';
- 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_group
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function edit_group($id) {
$id = (int) $id;
$group = $this->db->get_where('content_field_groups', ['id' => $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"
Further reading
Function edit_field_data_type
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function edit_field_data_type($field_name) {
$form = $this->get_form('create_field');
$form->action = $this->get_url('edit_field_data_type/' . $field_name);
$form->title = lang('Field editing', 'cfcm');
- 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"