Showing 44 of 44 total issues
Function addHandler
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function addHandler($handler) : MacroProcessor
{
if (is_callable($handler)){
$this->handlers[] = $handler;
}
- 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 dump
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function dump($var, string $format = 'html', int $back = 0, array $options = null, bool $return = false, int $max_depth = 6 ): ?string
Function process
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function process(string $keyword) : string
{
foreach($this->handlers as $handler){
if (is_callable($handler)){
$keyword = $handler($keyword);
- 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 stripSlashes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function stripSlashes( $value )
{
if ( is_string($value) ){
return stripslashes($value);
}
- 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 stripTags
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function stripTags($value, string $allowable_tags = null)
{
if ( is_string($value) ){
return strip_tags($value, $allowable_tags);
}
- 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 escape
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function escape( $value )
{
if ( is_string($value) ){
return htmlspecialchars($value, ENT_QUOTES, mb_internal_encoding());
}
- 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 date('d');
Avoid too many return
statements within this method. Open
return date('n');
Avoid too many return
statements within this method. Open
return date('h');
Avoid too many return
statements within this method. Open
return intval($number);
Avoid too many return
statements within this method. Open
return date('j');
Avoid too many return
statements within this method. Open
return date('s');
Avoid too many return
statements within this method. Open
return sprintf("%06d",($t - floor($t)) * 1000000);
Avoid too many return
statements within this method. Open
return get_class( $value ) . '(hash=' . $value->hash() . ')';
Avoid too many return
statements within this method. Open
return date('i');
Avoid too many return
statements within this method. Open
return $keyword;
Avoid too many return
statements within this method. Open
return get_class( $value ) . '(' . count($value) . ')';
Avoid too many return
statements within this method. Open
return intval($size_string);
Avoid too many return
statements within this method. Open
return date('H');
Avoid too many return
statements within this method. Open
return round( ((float)$value) / self::BYTES_TB, $precision );