qcubed/framework

View on GitHub
includes/base_controls/QImageBase.class.php

Summary

Maintainability
F
5 days
Test Coverage

File QImageBase.class.php has 317 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
    /**
     * This file contains the QImageBase class.
     *
     * @package Controls
Severity: Minor
Found in includes/base_controls/QImageBase.class.php - About 3 hrs to fix

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

        abstract class QImageBase extends QControl {
            ///////////////////////////
            // Private Member Variables
            ///////////////////////////
    
    

    Method RenderImageMagickHelper has 56 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            protected function RenderImageMagickHelper($objFinalImage, $strPath) {
                // Output the Image (if path isn't specified, output to buffer.  Otherwise, output to disk)
                if (!$strPath) {
                    $strPath = $this->strImagickTempFilePath . '/image_' . str_replace('.', '_', microtime(true));
    
    
    Severity: Major
    Found in includes/base_controls/QImageBase.class.php - About 2 hrs to fix

      Method __set has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              public function __set($strName, $mixValue) {
                  $this->blnModified = true;
      
                  switch ($strName) {
                      case "CacheFolder":
      Severity: Major
      Found in includes/base_controls/QImageBase.class.php - About 2 hrs to fix

        Function RenderImageMagickHelper has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

                protected function RenderImageMagickHelper($objFinalImage, $strPath) {
                    // Output the Image (if path isn't specified, output to buffer.  Otherwise, output to disk)
                    if (!$strPath) {
                        $strPath = $this->strImagickTempFilePath . '/image_' . str_replace('.', '_', microtime(true));
        
        
        Severity: Minor
        Found in includes/base_controls/QImageBase.class.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 RenderAsImgSrc has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                public function RenderAsImgSrc($blnDisplayOutput = true) {
                    // Serialize and Hash Data
                    $strSerialized = $this->Serialize();
                    $strHash = md5($strSerialized);
        
        
        Severity: Minor
        Found in includes/base_controls/QImageBase.class.php - About 1 hr to fix

          Method GetControlHtml has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  protected function GetControlHtml() {
                      try {
                          // Figure Out the Path
                          $strPath = $this->RenderAsImgSrc(false);
                      } catch (QCallerException $objExc) {
          Severity: Minor
          Found in includes/base_controls/QImageBase.class.php - About 1 hr to fix

            Method RenderImageHelper has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    protected function RenderImageHelper($objFinalImage, $strPath) {
                        // Output the Image (if path isn't specified, output to buffer.  Otherwise, output to disk)
                        if (!$strPath) {
                            // Output to Output Stream
                            QApplication::$ProcessOutput = false;
            Severity: Minor
            Found in includes/base_controls/QImageBase.class.php - About 1 hr to fix

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

                      public function __set($strName, $mixValue) {
                          $this->blnModified = true;
              
                          switch ($strName) {
                              case "CacheFolder":
              Severity: Minor
              Found in includes/base_controls/QImageBase.class.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 RenderAsImgSrc has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

                      public function RenderAsImgSrc($blnDisplayOutput = true) {
                          // Serialize and Hash Data
                          $strSerialized = $this->Serialize();
                          $strHash = md5($strSerialized);
              
              
              Severity: Minor
              Found in includes/base_controls/QImageBase.class.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 RenderImageHelper has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                      protected function RenderImageHelper($objFinalImage, $strPath) {
                          // Output the Image (if path isn't specified, output to buffer.  Otherwise, output to disk)
                          if (!$strPath) {
                              // Output to Output Stream
                              QApplication::$ProcessOutput = false;
              Severity: Minor
              Found in includes/base_controls/QImageBase.class.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 GetControlHtml has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                      protected function GetControlHtml() {
                          try {
                              // Figure Out the Path
                              $strPath = $this->RenderAsImgSrc(false);
                          } catch (QCallerException $objExc) {
              Severity: Minor
              Found in includes/base_controls/QImageBase.class.php - About 45 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

              Avoid too many return statements within this method.
              Open

                              case "JpegQuality": return $this->intJpegQuality;
              Severity: Major
              Found in includes/base_controls/QImageBase.class.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                        return parent::__get($strName);
                Severity: Major
                Found in includes/base_controls/QImageBase.class.php - About 30 mins to fix

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

                          public function __set($strName, $mixValue) {
                              $this->blnModified = true;
                  
                              switch ($strName) {
                                  case "CacheFolder":

                  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 RenderAsImgSrc has a boolean flag argument $blnDisplayOutput, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                          public function RenderAsImgSrc($blnDisplayOutput = true) {

                  BooleanArgumentFlag

                  Since: 1.4.0

                  A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                  Example

                  class Foo {
                      public function bar($flag = true) {
                      }
                  }

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

                  Avoid using static access to class 'QApplication' in method 'RenderImageHelper'.
                  Open

                                  QApplication::MakeDirectory(dirname($strPath), 0777);

                  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 'QType' in method '__set'.
                  Open

                                          $this->strCacheFolder = QType::Cast($mixValue, QType::String);

                  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 'QApplication' in method 'GetControlHtml'.
                  Open

                                  $strAlt = ' alt="' . QApplication::HtmlEntities($this->strAlternateText) . '"';

                  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 'QApplication' in method 'Run'.
                  Open

                              $strData = QApplication::QueryString('q');

                  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 RenderImageHelper uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  // Make Directory
                                  QApplication::MakeDirectory(dirname($strPath), 0777);
                  
                                  // Output to Disk

                  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

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

                              } else {
                                  // Make Directory
                                  QApplication::MakeDirectory(dirname($strPath), 0777);
                  
                                  // Output to Disk

                  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 'QType' in method '__set'.
                  Open

                                          $this->strCacheFilename = QType::Cast($mixValue, QType::String);

                  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 'QType' in method '__set'.
                  Open

                                          $this->strImageType = QType::Cast($mixValue, QType::String);

                  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 'QApplication' in method 'RenderImageMagickHelper'.
                  Open

                                  QApplication::MakeDirectory(dirname($strPath), 0777);

                  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 RenderAsImgSrc uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  $strPath = sprintf('%s/image_base.php/%s/%s?q=%s',
                                      __VIRTUAL_DIRECTORY__ . __PHP_ASSETS__,
                                      $this->strControlClassName,
                                      $strImageFilename,

                  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

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

                              } else {
                                  // Setup Style and Other Attribute Information (EXCEPT for "BackColor", "Width" and "Height")
                                  $strBackColor = $this->strBackColor;
                                  $strWidth = $this->strWidth;
                                  $strHeight = $this->strHeight;

                  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

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

                              else {
                                  $strImageFilename = $strHash;
                  
                                  switch ($this->strImageType) {
                                      case QImageType::Gif:

                  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 'QType' in method '__set'.
                  Open

                                          $this->strAlternateText = QType::Cast($mixValue, QType::String);

                  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 'QType' in method '__set'.
                  Open

                                          $this->intJpegQuality = QType::Cast($mixValue, QType::Integer);

                  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

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                          public function __set($strName, $mixValue) {
                              $this->blnModified = true;
                  
                              switch ($strName) {
                                  case "CacheFolder":
                  Severity: Major
                  Found in includes/base_controls/QImageBase.class.php and 1 other location - About 1 day to fix
                  includes/base_controls/QWaitIcon.class.php on lines 151..210

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 293.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                              if ($this->strCachedActualFilePath) {
                                  $objDimensions = getimagesize($this->strCachedActualFilePath);
                  
                                  // Setup Style and Other Attribute Information (EXCEPT for "BackColor")
                                  // Use actual "Width" and "Height" values from cached image
                  Severity: Major
                  Found in includes/base_controls/QImageBase.class.php and 1 other location - About 1 day to fix
                  includes/base_controls/QImageControlBase.class.php on lines 135..166

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 272.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                          public static function Run() {
                              $strData = QApplication::QueryString('q');
                              $strData = str_replace('-', '+', $strData);
                              $strData = str_replace('_', '/', $strData);
                  
                  
                  Severity: Major
                  Found in includes/base_controls/QImageBase.class.php and 1 other location - About 1 hr to fix
                  includes/base_controls/QImageControlBase.class.php on lines 200..212

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 118.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                              if ($this->strCacheFolder) {
                                  $strFilePath = sprintf('%s%s/%s',
                                      __DOCROOT__,
                                      str_replace(__VIRTUAL_DIRECTORY__, '', $this->strCacheFolder),
                                      $strImageFilename);
                  Severity: Minor
                  Found in includes/base_controls/QImageBase.class.php and 1 other location - About 55 mins to fix
                  includes/base_controls/QImageControlBase.class.php on lines 86..117

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 99.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Avoid excessively long variable names like $strCachedActualFilePath. Keep variable name length under 20.
                  Open

                          protected $strCachedActualFilePath = null;

                  LongVariable

                  Since: 0.2

                  Detects when a field, formal or local variable is declared with a long name.

                  Example

                  class Something {
                      protected $reallyLongIntName = -3; // VIOLATION - Field
                      public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                          $otherReallyLongName = -5; // VIOLATION - Local
                          for ($interestingIntIndex = 0; // VIOLATION - For
                               $interestingIntIndex < 10;
                               $interestingIntIndex++ ) {
                          }
                      }
                  }

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

                  Avoid excessively long variable names like $strImagickTempFilePath. Keep variable name length under 20.
                  Open

                          protected $strImagickTempFilePath = '/tmp';

                  LongVariable

                  Since: 0.2

                  Detects when a field, formal or local variable is declared with a long name.

                  Example

                  class Something {
                      protected $reallyLongIntName = -3; // VIOLATION - Field
                      public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                          $otherReallyLongName = -5; // VIOLATION - Local
                          for ($interestingIntIndex = 0; // VIOLATION - For
                               $interestingIntIndex < 10;
                               $interestingIntIndex++ ) {
                          }
                      }
                  }

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

                  The method Run is not named in camelCase.
                  Open

                          public static function Run() {
                              $strData = QApplication::QueryString('q');
                              $strData = str_replace('-', '+', $strData);
                              $strData = str_replace('_', '/', $strData);
                  
                  

                  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 RenderImageHelper is not named in camelCase.
                  Open

                          protected function RenderImageHelper($objFinalImage, $strPath) {
                              // Output the Image (if path isn't specified, output to buffer.  Otherwise, output to disk)
                              if (!$strPath) {
                                  // Output to Output Stream
                                  QApplication::$ProcessOutput = false;

                  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 ParsePostData is not named in camelCase.
                  Open

                          public function ParsePostData() {}

                  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 Validate is not named in camelCase.
                  Open

                          public function Validate() {return true;}

                  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 GetControlHtml is not named in camelCase.
                  Open

                          protected function GetControlHtml() {
                              try {
                                  // Figure Out the Path
                                  $strPath = $this->RenderAsImgSrc(false);
                              } catch (QCallerException $objExc) {

                  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 RenderImage is not named in camelCase.
                  Open

                          abstract public function RenderImage($strPath = null);

                  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 Serialize is not named in camelCase.
                  Open

                          public function Serialize() {
                              $objControl = clone($this);
                              $objControl->objForm = null;
                              $objControl->objParentControl = null;
                              $objControl->strCacheFilename = null;

                  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 RenderImageMagickHelper is not named in camelCase.
                  Open

                          protected function RenderImageMagickHelper($objFinalImage, $strPath) {
                              // Output the Image (if path isn't specified, output to buffer.  Otherwise, output to disk)
                              if (!$strPath) {
                                  $strPath = $this->strImagickTempFilePath . '/image_' . str_replace('.', '_', microtime(true));
                  
                  

                  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 RenderAsImgSrc is not named in camelCase.
                  Open

                          public function RenderAsImgSrc($blnDisplayOutput = true) {
                              // Serialize and Hash Data
                              $strSerialized = $this->Serialize();
                              $strHash = md5($strSerialized);
                  
                  

                  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