CaffGeek/MBACNationals

View on GitHub
Web.Admin/2014/wordpress/wp-includes/class-wp-image-editor.php

Summary

Maintainability
B
4 hrs
Test Coverage

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
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-image-editor.php - About 1 hr to fix

    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
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-image-editor.php - About 55 mins to fix

    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 );
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-image-editor.php - About 50 mins to fix

      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;
              }
      
      
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/class-wp-image-editor.php - About 35 mins to fix

      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.
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/class-wp-image-editor.php - About 35 mins to fix

      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

      There are no issues that match your filters.

      Category
      Status