flyimg/flyimg

The class ImageProcessor has an overall complexity of 50 which is very high. The configured complexity threshold is 50.
Open
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

class ImageProcessor
{
    /** Bin path */
    const MOZJPEG_COMMAND = '/opt/mozjpeg/bin/cjpeg';
    const IM_CONVERT_COMMAND = '/usr/bin/convert';
Severity: Minor
Found in src/Core/Service/ImageProcessor.php by phpmd

Since: PHPMD 0.2.5

The Weighted Method Count (WMC) of a class is a good indicator of how much time and effort is required to modify and maintain this class. The WMC metric is defined as the sum of complexities of all methods declared in a class. A large number of methods also means that this class has a greater potential impact on derived classes.

Example:


  class Foo {
      public function bar() {
          if ($a == $b)  {
              if ($a1 == $b1) {
                  fiddle();
              } elseif ($a2 == $b2) {
                  fiddle();
              } else {
              }
          }
      }
      public function baz() {
          if ($a == $b) {
              if ($a1 == $b1) {
                  fiddle();
              } elseif ($a2 == $b2) {
                  fiddle();
              } else {
              }
          }
      }
      // Several other complex methods
  }


Source: http://phpmd.org/rules/codesize.txt

Severity
Category
Status

Join us for Code Climate
Summit on July 19 in NYC.

Tickets on sale now.