Method exportObject
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected static function exportObject($var, $depth = 1, $indent = 0)
{
$out = '';
$props = [];
$className = get_class($var);
Function exportObject
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected static function exportObject($var, $depth = 1, $indent = 0)
{
$out = '';
$props = [];
$className = get_class($var);
- 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 trace
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function trace($backtrace = null, $options = array())
{
if (is_null($backtrace)) {
$backtrace = debug_backtrace();
}
Function trace
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function trace($backtrace = null, $options = array())
{
if (is_null($backtrace)) {
$backtrace = debug_backtrace();
}
- 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 exportArray
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected static function exportArray(array $var, $depth = 1, $indent = 0)
{
$out = "[";
$break = $end = null;
if (!empty($var)) {
- 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 getType
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function getType($var)
{
if (is_object($var)) {
return get_class($var);
}
- 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 strtolower(gettype($var));
Avoid too many return
statements within this method. Open
return 'boolean';
Avoid too many return
statements within this method. Open
return 'float';
Avoid too many return
statements within this method. Open
return 'integer';
Avoid too many return
statements within this method. Open
return "'" . $var . "'";
Avoid too many return
statements within this method. Open
return static::exportObject($var, $depth - 1, $indent + 1);
Avoid too many return
statements within this method. Open
return static::exportArray($var, $depth - 1, $indent + 1);
Avoid too many return
statements within this method. Open
return 'null';
Avoid too many return
statements within this method. Open
return 'unknown';
Avoid too many return
statements within this method. Open
return 'unknown';
Avoid too many return
statements within this method. Open
return 'resource';