mambax7/extgallery

View on GitHub
class/pear/Image/Transform/Driver/NetPBM.php

Summary

Maintainability
D
1 day
Test Coverage

Method _postProcess has 107 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function _postProcess($type, $quality)
    {
        array_unshift($this->command, $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, mb_strtolower($this->type) . 'topnm', escapeshellarg($this->image)));
        $arg     = '';
        $type    = mb_strtolower($type);
Severity: Major
Found in class/pear/Image/Transform/Driver/NetPBM.php - About 4 hrs to fix

    The class Image_Transform_Driver_NetPBM has an overall complexity of 139 which is very high. The configured complexity threshold is 50.
    Open

    class Image_Transform_Driver_NetPBM extends Image_Transform
    {
        /**
         * associative array commands to be executed
         * @var array

    The class Image_Transform_Driver_NetPBM has 15 public methods. Consider refactoring Image_Transform_Driver_NetPBM to keep number of public methods under 10.
    Open

    class Image_Transform_Driver_NetPBM extends Image_Transform
    {
        /**
         * associative array commands to be executed
         * @var array

    TooManyPublicMethods

    Since: 0.1

    A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

    By default it ignores methods starting with 'get' or 'set'.

    Example

    Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

    File NetPBM.php has 301 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    /* vim: set expandtab tabstop=4 shiftwidth=4: */
    
    /**
    Severity: Minor
    Found in class/pear/Image/Transform/Driver/NetPBM.php - About 3 hrs to fix

      Function _resize has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          public function _resize($new_x, $new_y, $options = null)
          {
              // there's no technical reason why resize can't be called multiple
              // times...it's just silly to do so
              $scaleMethod = $this->_getOption('scaleMethod', $options, 'smooth');
      Severity: Minor
      Found in class/pear/Image/Transform/Driver/NetPBM.php - About 1 hr 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 rotate has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          public function rotate($angle, $options = null)
          {
              if (!($angle == $this->_rotation_angle($angle))) {
                  // No rotation needed
                  return true;
      Severity: Minor
      Found in class/pear/Image/Transform/Driver/NetPBM.php - About 1 hr 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 _postProcess has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public function _postProcess($type, $quality)
          {
              array_unshift($this->command, $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, mb_strtolower($this->type) . 'topnm', escapeshellarg($this->image)));
              $arg     = '';
              $type    = mb_strtolower($type);
      Severity: Minor
      Found in class/pear/Image/Transform/Driver/NetPBM.php - About 1 hr 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 _resize has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function _resize($new_x, $new_y, $options = null)
          {
              // there's no technical reason why resize can't be called multiple
              // times...it's just silly to do so
              $scaleMethod = $this->_getOption('scaleMethod', $options, 'smooth');
      Severity: Minor
      Found in class/pear/Image/Transform/Driver/NetPBM.php - About 1 hr to fix

        Method rotate has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function rotate($angle, $options = null)
            {
                if (!($angle == $this->_rotation_angle($angle))) {
                    // No rotation needed
                    return true;
        Severity: Minor
        Found in class/pear/Image/Transform/Driver/NetPBM.php - About 1 hr to fix

          The method rotate() has an NPath complexity of 204. The configured NPath complexity threshold is 200.
          Open

              public function rotate($angle, $options = null)
              {
                  if (!($angle == $this->_rotation_angle($angle))) {
                      // No rotation needed
                      return true;

          NPathComplexity

          Since: 0.1

          The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

          Example

          class Foo {
              function bar() {
                  // lots of complicated code
              }
          }

          Source https://phpmd.org/rules/codesize.html#npathcomplexity

          The method _postProcess() has an NPath complexity of 584. The configured NPath complexity threshold is 200.
          Open

              public function _postProcess($type, $quality)
              {
                  array_unshift($this->command, $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, mb_strtolower($this->type) . 'topnm', escapeshellarg($this->image)));
                  $arg     = '';
                  $type    = mb_strtolower($type);

          NPathComplexity

          Since: 0.1

          The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

          Example

          class Foo {
              function bar() {
                  // lots of complicated code
              }
          }

          Source https://phpmd.org/rules/codesize.html#npathcomplexity

          The method _postProcess() has 123 lines of code. Current threshold is set to 100. Avoid really long methods.
          Open

              public function _postProcess($type, $quality)
              {
                  array_unshift($this->command, $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, mb_strtolower($this->type) . 'topnm', escapeshellarg($this->image)));
                  $arg     = '';
                  $type    = mb_strtolower($type);

          The method _resize() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10.
          Open

              public function _resize($new_x, $new_y, $options = null)
              {
                  // there's no technical reason why resize can't be called multiple
                  // times...it's just silly to do so
                  $scaleMethod = $this->_getOption('scaleMethod', $options, 'smooth');

          CyclomaticComplexity

          Since: 0.1

          Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

          Example

          // Cyclomatic Complexity = 11
          class Foo {
          1   public function example() {
          2       if ($a == $b) {
          3           if ($a1 == $b1) {
                          fiddle();
          4           } elseif ($a2 == $b2) {
                          fiddle();
                      } else {
                          fiddle();
                      }
          5       } elseif ($c == $d) {
          6           while ($c == $d) {
                          fiddle();
                      }
          7        } elseif ($e == $f) {
          8           for ($n = 0; $n < $h; $n++) {
                          fiddle();
                      }
                  } else {
                      switch ($z) {
          9               case 1:
                              fiddle();
                              break;
          10              case 2:
                              fiddle();
                              break;
          11              case 3:
                              fiddle();
                              break;
                          default:
                              fiddle();
                              break;
                      }
                  }
              }
          }

          Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

          The method _postProcess() has a Cyclomatic Complexity of 76. The configured cyclomatic complexity threshold is 10.
          Open

              public function _postProcess($type, $quality)
              {
                  array_unshift($this->command, $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, mb_strtolower($this->type) . 'topnm', escapeshellarg($this->image)));
                  $arg     = '';
                  $type    = mb_strtolower($type);

          CyclomaticComplexity

          Since: 0.1

          Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

          Example

          // Cyclomatic Complexity = 11
          class Foo {
          1   public function example() {
          2       if ($a == $b) {
          3           if ($a1 == $b1) {
                          fiddle();
          4           } elseif ($a2 == $b2) {
                          fiddle();
                      } else {
                          fiddle();
                      }
          5       } elseif ($c == $d) {
          6           while ($c == $d) {
                          fiddle();
                      }
          7        } elseif ($e == $f) {
          8           for ($n = 0; $n < $h; $n++) {
                          fiddle();
                      }
                  } else {
                      switch ($z) {
          9               case 1:
                              fiddle();
                              break;
          10              case 2:
                              fiddle();
                              break;
          11              case 3:
                              fiddle();
                              break;
                          default:
                              fiddle();
                              break;
                      }
                  }
              }
          }

          Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

          The method rotate() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
          Open

              public function rotate($angle, $options = null)
              {
                  if (!($angle == $this->_rotation_angle($angle))) {
                      // No rotation needed
                      return true;

          CyclomaticComplexity

          Since: 0.1

          Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

          Example

          // Cyclomatic Complexity = 11
          class Foo {
          1   public function example() {
          2       if ($a == $b) {
          3           if ($a1 == $b1) {
                          fiddle();
          4           } elseif ($a2 == $b2) {
                          fiddle();
                      } else {
                          fiddle();
                      }
          5       } elseif ($c == $d) {
          6           while ($c == $d) {
                          fiddle();
                      }
          7        } elseif ($e == $f) {
          8           for ($n = 0; $n < $h; $n++) {
                          fiddle();
                      }
                  } else {
                      switch ($z) {
          9               case 1:
                              fiddle();
                              break;
          10              case 2:
                              fiddle();
                              break;
          11              case 3:
                              fiddle();
                              break;
                          default:
                              fiddle();
                              break;
                      }
                  }
              }
          }

          Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

          Avoid using undefined variables such as '$angle' which will lead to PHP notices.
          Open

                  $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'ppmlabel', '-angle ' . ((int)$angle) . ' -colour ' . escapeshellarg($color) . ' -size ' . ((float)$size) . ' -x ' . ((int)$x) . ' -y ' . $y + $size . ' -text ' . escapeshellarg($text));

          UndefinedVariable

          Since: 2.8.0

          Detects when a variable is used that has not been defined before.

          Example

          class Foo
          {
              private function bar()
              {
                  // $message is undefined
                  echo $message;
              }
          }

          Source https://phpmd.org/rules/cleancode.html#undefinedvariable

          Avoid using undefined variables such as '$size' which will lead to PHP notices.
          Open

                  $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'ppmlabel', '-angle ' . ((int)$angle) . ' -colour ' . escapeshellarg($color) . ' -size ' . ((float)$size) . ' -x ' . ((int)$x) . ' -y ' . $y + $size . ' -text ' . escapeshellarg($text));

          UndefinedVariable

          Since: 2.8.0

          Detects when a variable is used that has not been defined before.

          Example

          class Foo
          {
              private function bar()
              {
                  // $message is undefined
                  echo $message;
              }
          }

          Source https://phpmd.org/rules/cleancode.html#undefinedvariable

          Avoid using undefined variables such as '$size' which will lead to PHP notices.
          Open

                  $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'ppmlabel', '-angle ' . ((int)$angle) . ' -colour ' . escapeshellarg($color) . ' -size ' . ((float)$size) . ' -x ' . ((int)$x) . ' -y ' . $y + $size . ' -text ' . escapeshellarg($text));

          UndefinedVariable

          Since: 2.8.0

          Detects when a variable is used that has not been defined before.

          Example

          class Foo
          {
              private function bar()
              {
                  // $message is undefined
                  echo $message;
              }
          }

          Source https://phpmd.org/rules/cleancode.html#undefinedvariable

          Avoid using undefined variables such as '$outputgamme' which will lead to PHP notices.
          Open

                  if (1.0 != $outputgamme) {

          UndefinedVariable

          Since: 2.8.0

          Detects when a variable is used that has not been defined before.

          Example

          class Foo
          {
              private function bar()
              {
                  // $message is undefined
                  echo $message;
              }
          }

          Source https://phpmd.org/rules/cleancode.html#undefinedvariable

          Avoid using undefined variables such as '$x' which will lead to PHP notices.
          Open

                  $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'ppmlabel', '-angle ' . ((int)$angle) . ' -colour ' . escapeshellarg($color) . ' -size ' . ((float)$size) . ' -x ' . ((int)$x) . ' -y ' . $y + $size . ' -text ' . escapeshellarg($text));

          UndefinedVariable

          Since: 2.8.0

          Detects when a variable is used that has not been defined before.

          Example

          class Foo
          {
              private function bar()
              {
                  // $message is undefined
                  echo $message;
              }
          }

          Source https://phpmd.org/rules/cleancode.html#undefinedvariable

          Avoid using undefined variables such as '$text' which will lead to PHP notices.
          Open

                  $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'ppmlabel', '-angle ' . ((int)$angle) . ' -colour ' . escapeshellarg($color) . ' -size ' . ((float)$size) . ' -x ' . ((int)$x) . ' -y ' . $y + $size . ' -text ' . escapeshellarg($text));

          UndefinedVariable

          Since: 2.8.0

          Detects when a variable is used that has not been defined before.

          Example

          class Foo
          {
              private function bar()
              {
                  // $message is undefined
                  echo $message;
              }
          }

          Source https://phpmd.org/rules/cleancode.html#undefinedvariable

          Avoid using undefined variables such as '$y' which will lead to PHP notices.
          Open

                  $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'ppmlabel', '-angle ' . ((int)$angle) . ' -colour ' . escapeshellarg($color) . ' -size ' . ((float)$size) . ' -x ' . ((int)$x) . ' -y ' . $y + $size . ' -text ' . escapeshellarg($text));

          UndefinedVariable

          Since: 2.8.0

          Detects when a variable is used that has not been defined before.

          Example

          class Foo
          {
              private function bar()
              {
                  // $message is undefined
                  echo $message;
              }
          }

          Source https://phpmd.org/rules/cleancode.html#undefinedvariable

          Avoid using static access to class 'PEAR' in method '__construct'.
          Open

                      $this->isError(PEAR::raiseError('Couldn\'t find "pnmscale" binary', IMAGE_TRANSFORM_ERROR_UNSUPPORTED));

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'System' in method '__construct'.
          Open

                  if (!System::which(IMAGE_TRANSFORM_NETPBM_PATH . 'pnmscale' . (OS_WINDOWS ? '.exe' : ''))) {

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'System' in method '__construct'.
          Open

                      $path = \dirname(System::which('pnmscale')) . DIRECTORY_SEPARATOR;

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          The method _resize uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
          Open

                              } else {
                                  return PEAR::raiseError('Couldn\'t find "pnmsmooth" binary', IMAGE_TRANSFORM_ERROR_UNSUPPORTED);
                              }

          ElseExpression

          Since: 1.4.0

          An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

          Example

          class Foo
          {
              public function bar($flag)
              {
                  if ($flag) {
                      // one branch
                  } else {
                      // another branch
                  }
              }
          }

          Source https://phpmd.org/rules/cleancode.html#elseexpression

          Avoid using static access to class 'PEAR' in method '_resize'.
          Open

                                  return PEAR::raiseError('Couldn\'t find "pnmenlarge" binary', IMAGE_TRANSFORM_ERROR_UNSUPPORTED);

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'System' in method '_resize'.
          Open

                              if (System::which(IMAGE_TRANSFORM_NETPBM_PATH . 'pnmsmooth' . (OS_WINDOWS ? '.exe' : ''))) {

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          The method _resize uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
          Open

                              } else {
                                  return PEAR::raiseError('Couldn\'t find "pnmenlarge" binary', IMAGE_TRANSFORM_ERROR_UNSUPPORTED);
                              }

          ElseExpression

          Since: 1.4.0

          An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

          Example

          class Foo
          {
              public function bar($flag)
              {
                  if ($flag) {
                      // one branch
                  } else {
                      // another branch
                  }
              }
          }

          Source https://phpmd.org/rules/cleancode.html#elseexpression

          Avoid using static access to class 'PEAR' in method 'load'.
          Open

                  if (PEAR::isError($result)) {

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'System' in method '_resize'.
          Open

                              if (System::which(IMAGE_TRANSFORM_NETPBM_PATH . 'pnmenlarge' . (OS_WINDOWS ? '.exe' : ''))) {

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          The method _resize uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
          Open

                          } else {
                              $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'pnmscale', '-nomix -width ' . ((int)$new_x) . ' -height ' . ((int)$new_y));
                          }

          ElseExpression

          Since: 1.4.0

          An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

          Example

          class Foo
          {
              public function bar($flag)
              {
                  if ($flag) {
                      // one branch
                  } else {
                      // another branch
                  }
              }
          }

          Source https://phpmd.org/rules/cleancode.html#elseexpression

          Avoid using static access to class 'System' in method 'flip'.
          Open

                  if (!System::which(IMAGE_TRANSFORM_NETPBM_PATH . 'pamflip' . (OS_WINDOWS ? '.exe' : ''))) {

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'System' in method 'rotate'.
          Open

                      if (!System::which(IMAGE_TRANSFORM_NETPBM_PATH . 'pnmrotate' . (OS_WINDOWS ? '.exe' : ''))) {

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          The method rotate uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
          Open

                      } else {
                          $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'pnmrotate', '-background=' . $bgcolor . ' -noantialias -' . (float)$angle);
                      }

          ElseExpression

          Since: 1.4.0

          An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

          Example

          class Foo
          {
              public function bar($flag)
              {
                  if ($flag) {
                      // one branch
                  } else {
                      // another branch
                  }
              }
          }

          Source https://phpmd.org/rules/cleancode.html#elseexpression

          Avoid using static access to class 'System' in method '_postProcess'.
          Open

                  if (!System::which(IMAGE_TRANSFORM_NETPBM_PATH . $program . (OS_WINDOWS ? '.exe' : ''))) {

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'PEAR' in method 'crop'.
          Open

                      return PEAR::raiseError('Nothing to crop', IMAGE_TRANSFORM_ERROR_OUTOFBOUND);

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'PEAR' in method 'flip'.
          Open

                      return PEAR::raiseError('Couldn\'t find "pamflip" binary', IMAGE_TRANSFORM_ERROR_UNSUPPORTED);

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'System' in method 'mirror'.
          Open

                  if (!System::which(IMAGE_TRANSFORM_NETPBM_PATH . 'pamflip' . (OS_WINDOWS ? '.exe' : ''))) {

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'System' in method 'greyscale'.
          Open

                  if (!System::which(IMAGE_TRANSFORM_NETPBM_PATH . 'ppmtopgm' . (OS_WINDOWS ? '.exe' : ''))) {

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'System' in method 'gamma'.
          Open

                      if (!System::which(IMAGE_TRANSFORM_NETPBM_PATH . 'pnmgamma' . (OS_WINDOWS ? '.exe' : ''))) {

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'PEAR' in method 'gamma'.
          Open

                          return PEAR::raiseError('Couldn\'t find "pnmgamma" binary', IMAGE_TRANSFORM_ERROR_UNSUPPORTED);

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'PEAR' in method 'mirror'.
          Open

                      return PEAR::raiseError('Couldn\'t find "pamflip" binary', IMAGE_TRANSFORM_ERROR_UNSUPPORTED);

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'System' in method '_postProcess'.
          Open

                          if (!System::which(IMAGE_TRANSFORM_NETPBM_PATH . 'ppmquant' . (OS_WINDOWS ? '.exe' : ''))) {

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'PEAR' in method 'crop'.
          Open

                          return PEAR::raiseError('Couldn\'t find "pnmcut" binary', IMAGE_TRANSFORM_ERROR_UNSUPPORTED);

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'System' in method 'rotate'.
          Open

                      if (!System::which(IMAGE_TRANSFORM_NETPBM_PATH . 'pamflip' . (OS_WINDOWS ? '.exe' : ''))) {

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'System' in method 'crop'.
          Open

                      if (!System::which(IMAGE_TRANSFORM_NETPBM_PATH . 'pnmcut' . (OS_WINDOWS ? '.exe' : ''))) {

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'System' in method 'addText'.
          Open

                  if (!System::which(IMAGE_TRANSFORM_NETPBM_PATH . 'ppmlabel' . (OS_WINDOWS ? '.exe' : ''))) {

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'PEAR' in method '_resize'.
          Open

                                  return PEAR::raiseError('Couldn\'t find "pnmsmooth" binary', IMAGE_TRANSFORM_ERROR_UNSUPPORTED);

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'PEAR' in method 'save'.
          Open

                  return (0 == $exit) ? true : PEAR::raiseError(implode('. ', $res), IMAGE_TRANSFORM_ERROR_IO);

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'PEAR' in method 'rotate'.
          Open

                          return PEAR::raiseError('Couldn\'t find "pamflip" binary', IMAGE_TRANSFORM_ERROR_UNSUPPORTED);

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'PEAR' in method 'rotate'.
          Open

                          return PEAR::raiseError('Couldn\'t find "pnmrotate" binary', IMAGE_TRANSFORM_ERROR_UNSUPPORTED);

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'PEAR' in method '_postProcess'.
          Open

                      return PEAR::raiseError("Couldn't find \"$program\" binary", IMAGE_TRANSFORM_ERROR_UNSUPPORTED);

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'PEAR' in method 'addText'.
          Open

                      return PEAR::raiseError('Couldn\'t find "ppmlabel" binary', IMAGE_TRANSFORM_ERROR_UNSUPPORTED);

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'PEAR' in method 'greyscale'.
          Open

                      return PEAR::raiseError('Couldn\'t find "ppmtopgm" binary', IMAGE_TRANSFORM_ERROR_UNSUPPORTED);

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'PEAR' in method '_postProcess'.
          Open

                              return PEAR::raiseError('Couldn\'t find "ppmquant" binary', IMAGE_TRANSFORM_ERROR_UNSUPPORTED);

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid unused local variables such as '$outputgamme'.
          Open

                  if (1.0 != $outputgamme) {

          UnusedLocalVariable

          Since: 0.2

          Detects when a local variable is declared and/or assigned, but not used.

          Example

          class Foo {
              public function doSomething()
              {
                  $i = 5; // Unused
              }
          }

          Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

          Avoid unused local variables such as '$text'.
          Open

                  $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'ppmlabel', '-angle ' . ((int)$angle) . ' -colour ' . escapeshellarg($color) . ' -size ' . ((float)$size) . ' -x ' . ((int)$x) . ' -y ' . $y + $size . ' -text ' . escapeshellarg($text));

          UnusedLocalVariable

          Since: 0.2

          Detects when a local variable is declared and/or assigned, but not used.

          Example

          class Foo {
              public function doSomething()
              {
                  $i = 5; // Unused
              }
          }

          Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

          Avoid unused local variables such as '$y'.
          Open

                  $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'ppmlabel', '-angle ' . ((int)$angle) . ' -colour ' . escapeshellarg($color) . ' -size ' . ((float)$size) . ' -x ' . ((int)$x) . ' -y ' . $y + $size . ' -text ' . escapeshellarg($text));

          UnusedLocalVariable

          Since: 0.2

          Detects when a local variable is declared and/or assigned, but not used.

          Example

          class Foo {
              public function doSomething()
              {
                  $i = 5; // Unused
              }
          }

          Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

          Avoid unused local variables such as '$arg'.
          Open

                  $arg     = '';

          UnusedLocalVariable

          Since: 0.2

          Detects when a local variable is declared and/or assigned, but not used.

          Example

          class Foo {
              public function doSomething()
              {
                  $i = 5; // Unused
              }
          }

          Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

          Avoid unused local variables such as '$angle'.
          Open

                  $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'ppmlabel', '-angle ' . ((int)$angle) . ' -colour ' . escapeshellarg($color) . ' -size ' . ((float)$size) . ' -x ' . ((int)$x) . ' -y ' . $y + $size . ' -text ' . escapeshellarg($text));

          UnusedLocalVariable

          Since: 0.2

          Detects when a local variable is declared and/or assigned, but not used.

          Example

          class Foo {
              public function doSomething()
              {
                  $i = 5; // Unused
              }
          }

          Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

          Avoid unused local variables such as '$x'.
          Open

                  $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'ppmlabel', '-angle ' . ((int)$angle) . ' -colour ' . escapeshellarg($color) . ' -size ' . ((float)$size) . ' -x ' . ((int)$x) . ' -y ' . $y + $size . ' -text ' . escapeshellarg($text));

          UnusedLocalVariable

          Since: 0.2

          Detects when a local variable is declared and/or assigned, but not used.

          Example

          class Foo {
              public function doSomething()
              {
                  $i = 5; // Unused
              }
          }

          Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

          Each class must be in a namespace of at least one level (a top-level vendor name)
          Open

          class Image_Transform_Driver_NetPBM extends Image_Transform

          The parameter $new_y is not named in camelCase.
          Open

              public function _resize($new_x, $new_y, $options = null)
              {
                  // there's no technical reason why resize can't be called multiple
                  // times...it's just silly to do so
                  $scaleMethod = $this->_getOption('scaleMethod', $options, 'smooth');

          CamelCaseParameterName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name parameters.

          Example

          class ClassName {
              public function doSomething($user_name) {
              }
          }

          Source

          The parameter $new_x is not named in camelCase.
          Open

              public function _resize($new_x, $new_y, $options = null)
              {
                  // there's no technical reason why resize can't be called multiple
                  // times...it's just silly to do so
                  $scaleMethod = $this->_getOption('scaleMethod', $options, 'smooth');

          CamelCaseParameterName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name parameters.

          Example

          class ClassName {
              public function doSomething($user_name) {
              }
          }

          Source

          The class Image_Transform_Driver_NetPBM is not named in CamelCase.
          Open

          class Image_Transform_Driver_NetPBM extends Image_Transform
          {
              /**
               * associative array commands to be executed
               * @var array

          CamelCaseClassName

          Since: 0.2

          It is considered best practice to use the CamelCase notation to name classes.

          Example

          class class_name {
          }

          Source

          Avoid variables with short names like $y. Configured minimum length is 3.
          Open

              public function crop($width, $height, $x = 0, $y = 0)

          ShortVariable

          Since: 0.2

          Detects when a field, local, or parameter has a very short name.

          Example

          class Something {
              private $q = 15; // VIOLATION - Field
              public static function main( array $as ) { // VIOLATION - Formal
                  $r = 20 + $this->q; // VIOLATION - Local
                  for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                      $r += $this->q;
                  }
              }
          }

          Source https://phpmd.org/rules/naming.html#shortvariable

          Avoid variables with short names like $x. Configured minimum length is 3.
          Open

              public function crop($width, $height, $x = 0, $y = 0)

          ShortVariable

          Since: 0.2

          Detects when a field, local, or parameter has a very short name.

          Example

          class Something {
              private $q = 15; // VIOLATION - Field
              public static function main( array $as ) { // VIOLATION - Formal
                  $r = 20 + $this->q; // VIOLATION - Local
                  for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                      $r += $this->q;
                  }
              }
          }

          Source https://phpmd.org/rules/naming.html#shortvariable

          A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 45 and the first side effect is on line 28.
          Open

          <?php

          Method name "Image_Transform_Driver_NetPBM::Image_Transform_Driver_NetPBM" is not in camel caps format
          Open

              public function Image_Transform_Driver_NetPBM()

          Method name "_resize" should not be prefixed with an underscore to indicate visibility
          Open

              public function _resize($new_x, $new_y, $options = null)

          Method name "_postProcess" should not be prefixed with an underscore to indicate visibility
          Open

              public function _postProcess($type, $quality)

          Line exceeds 120 characters; contains 147 characters
          Open

                          $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'pnmrotate', '-background=' . $bgcolor . ' -' . (float)$angle);

          Line exceeds 120 characters; contains 127 characters
          Open

                      $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'pamflip', '-rotate' . (360 - $quarters * 90));

          Line exceeds 120 characters; contains 195 characters
          Open

                      $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'pnmcut', '-left ' . ((int)$x) . ' -top ' . ((int)$y) . ' -width ' . ((int)$width) . ' -height ' . ((int)$height));

          Line exceeds 120 characters; contains 156 characters
          Open

                  array_unshift($this->command, $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, mb_strtolower($this->type) . 'topnm', escapeshellarg($this->image)));

          Line exceeds 120 characters; contains 121 characters
          Open

                                  return PEAR::raiseError('Couldn\'t find "pnmenlarge" binary', IMAGE_TRANSFORM_ERROR_UNSUPPORTED);

          Line exceeds 120 characters; contains 164 characters
          Open

                              $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'pnmscale', '-nomix -width ' . ((int)$new_x) . ' -height ' . ((int)$new_y));

          Line exceeds 120 characters; contains 160 characters
          Open

                          $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'pnmrotate', '-background=' . $bgcolor . ' -noantialias -' . (float)$angle);

          Line exceeds 120 characters; contains 262 characters
          Open

                  $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'ppmlabel', '-angle ' . ((int)$angle) . ' -colour ' . escapeshellarg($color) . ' -size ' . ((float)$size) . ' -x ' . ((int)$x) . ' -y ' . $y + $size . ' -text ' . escapeshellarg($text));

          Line exceeds 120 characters; contains 153 characters
          Open

                          $this->command[] = $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, 'pnmscale', '-width ' . ((int)$new_x) . ' -height ' . ((int)$new_y));

          Class name "Image_Transform_Driver_NetPBM" is not in camel caps format
          Open

          class Image_Transform_Driver_NetPBM extends Image_Transform

          The variable $scale_x is not named in camelCase.
          Open

              public function _resize($new_x, $new_y, $options = null)
              {
                  // there's no technical reason why resize can't be called multiple
                  // times...it's just silly to do so
                  $scaleMethod = $this->_getOption('scaleMethod', $options, 'smooth');

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $new_y is not named in camelCase.
          Open

              public function _resize($new_x, $new_y, $options = null)
              {
                  // there's no technical reason why resize can't be called multiple
                  // times...it's just silly to do so
                  $scaleMethod = $this->_getOption('scaleMethod', $options, 'smooth');

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $new_y is not named in camelCase.
          Open

              public function _resize($new_x, $new_y, $options = null)
              {
                  // there's no technical reason why resize can't be called multiple
                  // times...it's just silly to do so
                  $scaleMethod = $this->_getOption('scaleMethod', $options, 'smooth');

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $scale_x is not named in camelCase.
          Open

              public function _resize($new_x, $new_y, $options = null)
              {
                  // there's no technical reason why resize can't be called multiple
                  // times...it's just silly to do so
                  $scaleMethod = $this->_getOption('scaleMethod', $options, 'smooth');

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $scale_x is not named in camelCase.
          Open

              public function _resize($new_x, $new_y, $options = null)
              {
                  // there's no technical reason why resize can't be called multiple
                  // times...it's just silly to do so
                  $scaleMethod = $this->_getOption('scaleMethod', $options, 'smooth');

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $new_x is not named in camelCase.
          Open

              public function _resize($new_x, $new_y, $options = null)
              {
                  // there's no technical reason why resize can't be called multiple
                  // times...it's just silly to do so
                  $scaleMethod = $this->_getOption('scaleMethod', $options, 'smooth');

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $scale_x is not named in camelCase.
          Open

              public function _resize($new_x, $new_y, $options = null)
              {
                  // there's no technical reason why resize can't be called multiple
                  // times...it's just silly to do so
                  $scaleMethod = $this->_getOption('scaleMethod', $options, 'smooth');

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $new_x is not named in camelCase.
          Open

              public function _resize($new_x, $new_y, $options = null)
              {
                  // there's no technical reason why resize can't be called multiple
                  // times...it's just silly to do so
                  $scaleMethod = $this->_getOption('scaleMethod', $options, 'smooth');

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $scale_x is not named in camelCase.
          Open

              public function _resize($new_x, $new_y, $options = null)
              {
                  // there's no technical reason why resize can't be called multiple
                  // times...it's just silly to do so
                  $scaleMethod = $this->_getOption('scaleMethod', $options, 'smooth');

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $scale_x is not named in camelCase.
          Open

              public function _resize($new_x, $new_y, $options = null)
              {
                  // there's no technical reason why resize can't be called multiple
                  // times...it's just silly to do so
                  $scaleMethod = $this->_getOption('scaleMethod', $options, 'smooth');

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $new_y is not named in camelCase.
          Open

              public function _resize($new_x, $new_y, $options = null)
              {
                  // there's no technical reason why resize can't be called multiple
                  // times...it's just silly to do so
                  $scaleMethod = $this->_getOption('scaleMethod', $options, 'smooth');

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $new_x is not named in camelCase.
          Open

              public function _resize($new_x, $new_y, $options = null)
              {
                  // there's no technical reason why resize can't be called multiple
                  // times...it's just silly to do so
                  $scaleMethod = $this->_getOption('scaleMethod', $options, 'smooth');

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $new_y is not named in camelCase.
          Open

              public function _resize($new_x, $new_y, $options = null)
              {
                  // there's no technical reason why resize can't be called multiple
                  // times...it's just silly to do so
                  $scaleMethod = $this->_getOption('scaleMethod', $options, 'smooth');

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $new_y is not named in camelCase.
          Open

              public function _resize($new_x, $new_y, $options = null)
              {
                  // there's no technical reason why resize can't be called multiple
                  // times...it's just silly to do so
                  $scaleMethod = $this->_getOption('scaleMethod', $options, 'smooth');

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $new_x is not named in camelCase.
          Open

              public function _resize($new_x, $new_y, $options = null)
              {
                  // there's no technical reason why resize can't be called multiple
                  // times...it's just silly to do so
                  $scaleMethod = $this->_getOption('scaleMethod', $options, 'smooth');

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $new_x is not named in camelCase.
          Open

              public function _resize($new_x, $new_y, $options = null)
              {
                  // there's no technical reason why resize can't be called multiple
                  // times...it's just silly to do so
                  $scaleMethod = $this->_getOption('scaleMethod', $options, 'smooth');

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The method _resize is not named in camelCase.
          Open

              public function _resize($new_x, $new_y, $options = null)
              {
                  // there's no technical reason why resize can't be called multiple
                  // times...it's just silly to do so
                  $scaleMethod = $this->_getOption('scaleMethod', $options, 'smooth');

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method Image_Transform_Driver_NetPBM is not named in camelCase.
          Open

              public function Image_Transform_Driver_NetPBM()
              {
                  $this->__construct();
              }

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method _postProcess is not named in camelCase.
          Open

              public function _postProcess($type, $quality)
              {
                  array_unshift($this->command, $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, mb_strtolower($this->type) . 'topnm', escapeshellarg($this->image)));
                  $arg     = '';
                  $type    = mb_strtolower($type);

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          There are no issues that match your filters.

          Category
          Status