File yf_wrapper_redis.class.php
has 333 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Redis API wrapper.
*/
Function diff_config
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function diff_config($options = [])
{
if ( ! $options || ! is_array($options)) {
return null;
}
- 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
yf_wrapper_redis
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class yf_wrapper_redis
{
public $name = 'REDIS'; // instance name
public $driver = 'phpredis'; // predis|phpredis
Method diff_config
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function diff_config($options = [])
{
if ( ! $options || ! is_array($options)) {
return null;
}
Function call_try
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function call_try($name, $args)
{
$result = null;
$call_try = $this->call_try;
while ($call_try > 0) {
- 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 _get_conf
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _get_conf($key = null, array $options = [])
{
// lower
$k = strtolower($key);
if ( ! isset($this->config_default[$k])) {
Function _get_conf
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function _get_conf($key = null, array $options = [])
{
// lower
$k = strtolower($key);
if ( ! isset($this->config_default[$k])) {
- 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
Avoid too many return
statements within this method. Open
return $val;
Avoid too many return
statements within this method. Open
return $from_conf;
Avoid too many return
statements within this method. Open
return $default;
Avoid too many return
statements within this method. Open
return $from_env;
Avoid too many return
statements within this method. Open
return false;
Function __call
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function __call($name, $args)
{
if (DEBUG_MODE) {
$time_start = microtime(true);
}
- 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 conf
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function conf($opt = [])
{
! $this->is_connection() && $this->reconnect();
foreach ((array) $opt as $k => $v) {
if ($this->driver == 'phpredis') {
- 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 factory
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function factory($options = [])
{
if ( ! $options || ! is_array($options)) {
return $this;
}
- 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"