Function _prepare_to_save
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
public function _prepare_to_save($a)
{
$to_save = [];
foreach ((array) $a as $k => $v) {
if (is_string($v) && ! strlen($v)) {
- Read upRead up
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 display_what
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function display_what()
{
$hooks_data = _class('admin_methods')->call_hooks('settings', $r);
$avail_hook_modules = [];
foreach ((array) $hooks_data as $k => $v) {
Function display_what
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function display_what()
{
$hooks_data = _class('admin_methods')->call_hooks('settings', $r);
$avail_hook_modules = [];
foreach ((array) $hooks_data as $k => $v) {
- Read upRead up
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 _prepare_to_save
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _prepare_to_save($a)
{
$to_save = [];
foreach ((array) $a as $k => $v) {
if (is_string($v) && ! strlen($v)) {
Function show
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function show()
{
$r = [];
foreach ((array) conf() as $k => $v) {
if (is_array($v)) {
- Read upRead up
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 _get_settings
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function _get_settings($hooks_data)
{
$settings = db()->from('settings')->order_by('`order`, item ASC')->get_all();
if ( ! $settings && $hooks_data) {
$settings = [];
- Read upRead up
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"