Function _check_attr
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function _check_attr($name = '', $field) {
$return = '';
if ($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
Function add_fields
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function add_fields(array $fields = [], $edit = false) {
$defaults = $this->_config['default_attr'];
// Parse default settings
- 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 _check_attr
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _check_attr($name = '', $field) {
$return = '';
if ($name) {
- Create a ticketCreate a ticket
Function runValidation
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function runValidation() {
if (count($this->input->post())) {
foreach ($this->fields as $key => $val) {
if (isset($this->$key) AND method_exists($this->$key, 'runValidation')) {
- 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 setAttributes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function setAttributes($data = []) {
if (count($data) > 0 AND $data != FALSE) {
foreach ($data as $key => $val) {
if (isset($this->$key) AND method_exists($this->$key, 'setAttributes')) {
- 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 setInitial
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function setInitial($data = []) {
if (count($data)) {
foreach ($data as $key => $val) {
if (isset($this->$key) AND method_exists($this->$key, 'setInitial')) {
- 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 getData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getData() {
$data = [];
foreach ($this->fields as $key => $val) {
if (isset($this->$key) AND method_exists($this->$key, 'getData')) {
- 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"