Method get_output_format
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_output_format( $filename = null, $mime_type = null ) {
$new_ext = $file_ext = null;
$file_mime = null;
// By default, assume specified type takes priority
Function get_output_format
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function get_output_format( $filename = null, $mime_type = null ) {
$new_ext = $file_ext = null;
$file_mime = null;
// By default, assume specified type takes priority
- 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 crop
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
abstract public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false );
Function set_quality
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function set_quality( $quality = null ) {
if ( $quality == null ) {
$quality = $this->quality;
}
- 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 make_image
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function make_image( $filename, $function, $arguments ) {
if ( $stream = wp_is_stream( $filename ) ) {
ob_start();
} else {
// The directory containing the original file may no longer exist when using a replication plugin.
- 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"