qcubed/framework

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

Summary

Maintainability
F
3 days
Test Coverage

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

<?php
/**
 * This file contains the QImageBrowser class and supporting classes.
 *
 * @package Controls
Severity: Minor
Found in includes/base_controls/QImageBrowser.class.php - About 7 hrs to fix

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

        abstract class QImageBrowserBase extends QPanel {
            protected $intCurrentImage;
            protected $imgMainImage;
            protected $txtCaption;
            protected $btnSave;

    The class QImageBrowserBase has 13 public methods. Consider refactoring QImageBrowserBase to keep number of public methods under 10.
    Open

        abstract class QImageBrowserBase extends QPanel {
            protected $intCurrentImage;
            protected $imgMainImage;
            protected $txtCaption;
            protected $btnSave;

    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

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

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

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

              public function __set($strName, $mixValue) {
                  $this->blnModified = true;
      
                  switch ($strName) {
                      case "Navigation1":
      Severity: Minor
      Found in includes/base_controls/QImageBrowser.class.php - About 2 hrs 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 setMainImage has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

              protected function setMainImage($intIdx) {
                  $intCount = $this->ImageCount();
                  $blnBackButtonsEnabled = $intCount > 1 && $intIdx > 0;
                  $blnForwardButtonsEnabled = $intCount > 1 && $intIdx+1 < $intCount;
                  $this->ibnNavigation1->BackButtonsEnabled($blnBackButtonsEnabled);
      Severity: Minor
      Found in includes/base_controls/QImageBrowser.class.php - About 2 hrs 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 __set has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        Method setMainImage has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                protected function setMainImage($intIdx) {
                    $intCount = $this->ImageCount();
                    $blnBackButtonsEnabled = $intCount > 1 && $intIdx > 0;
                    $blnForwardButtonsEnabled = $intCount > 1 && $intIdx+1 < $intCount;
                    $this->ibnNavigation1->BackButtonsEnabled($blnBackButtonsEnabled);
        Severity: Minor
        Found in includes/base_controls/QImageBrowser.class.php - About 1 hr to fix

          Method __construct has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  public function __construct($objParentObject, $blnReadOnlyCaption = true, $blnTwoNavBars = false, $blnThumbnails = true, $strControlId = null) {
                      // Call the Parent
                      try {
                          parent::__construct($objParentObject, $strControlId);
                      } catch (QCallerException $objExc) {
          Severity: Minor
          Found in includes/base_controls/QImageBrowser.class.php - About 1 hr to fix

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

                    public function __set($strName, $mixValue) {
                        $this->blnModified = true;
            
                        switch ($strName) {
                            case "FirstButton":
            Severity: Minor
            Found in includes/base_controls/QImageBrowser.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 reload has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    public function reload() {
                        $this->RemoveChildControls(true);
                        $img = null;
                        // get the QImageBrowser control
                        $objImageBrowser = $this->ParentControl;
            Severity: Minor
            Found in includes/base_controls/QImageBrowser.class.php - About 1 hr to fix

              Function LoadImagesFromDirectory has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                      public function LoadImagesFromDirectory($strDir, $strPattern) {
                          if (!is_dir($strDir)) {
                              throw new QCallerException("$strDir is not a directory"); 
                          }
              
              
              Severity: Minor
              Found in includes/base_controls/QImageBrowser.class.php - About 55 mins to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      public function __construct($objParentObject, $blnReadOnlyCaption = true, $blnTwoNavBars = false, $blnThumbnails = true, $strControlId = null) {
              Severity: Minor
              Found in includes/base_controls/QImageBrowser.class.php - About 35 mins to fix

                Function reload has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                        public function reload() {
                            $this->RemoveChildControls(true);
                            $img = null;
                            // get the QImageBrowser control
                            $objImageBrowser = $this->ParentControl;
                Severity: Minor
                Found in includes/base_controls/QImageBrowser.class.php - About 35 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Avoid too many return statements within this method.
                Open

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

                  Avoid too many return statements within this method.
                  Open

                                  case "Thumbnails": return $this->ibtThumbnails;
                  Severity: Major
                  Found in includes/base_controls/QImageBrowser.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/QImageBrowser.class.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

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

                        Function setButtonActions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                                protected function setButtonActions(array $arrButtons = null) {
                                    // get the QImageBrowser control
                                    $objImageBrowser = $this->ParentControl;
                                    while ( !($objImageBrowser instanceof QImageBrowserBase) ) {
                                        $objImageBrowser = $objImageBrowser->ParentControl;
                        Severity: Minor
                        Found in includes/base_controls/QImageBrowser.class.php - About 25 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

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

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

                        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 __set() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
                        Open

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

                        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 setMainImage() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10.
                        Open

                                protected function setMainImage($intIdx) {
                                    $intCount = $this->ImageCount();
                                    $blnBackButtonsEnabled = $intCount > 1 && $intIdx > 0;
                                    $blnForwardButtonsEnabled = $intCount > 1 && $intIdx+1 < $intCount;
                                    $this->ibnNavigation1->BackButtonsEnabled($blnBackButtonsEnabled);

                        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 class QImageBrowserBase has a coupling between objects value of 13. Consider to reduce the number of dependencies under 13.
                        Open

                            abstract class QImageBrowserBase extends QPanel {
                                protected $intCurrentImage;
                                protected $imgMainImage;
                                protected $txtCaption;
                                protected $btnSave;

                        CouplingBetweenObjects

                        Since: 1.1.0

                        A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

                        Example

                        class Foo {
                            /**
                             * @var \foo\bar\X
                             */
                            private $x = null;
                        
                            /**
                             * @var \foo\bar\Y
                             */
                            private $y = null;
                        
                            /**
                             * @var \foo\bar\Z
                             */
                            private $z = null;
                        
                            public function setFoo(\Foo $foo) {}
                            public function setBar(\Bar $bar) {}
                            public function setBaz(\Baz $baz) {}
                        
                            /**
                             * @return \SplObjectStorage
                             * @throws \OutOfRangeException
                             * @throws \InvalidArgumentException
                             * @throws \ErrorException
                             */
                            public function process(\Iterator $it) {}
                        
                            // ...
                        }

                        Source https://phpmd.org/rules/design.html#couplingbetweenobjects

                        Missing class import via use statement (line '56', column '25').
                        Open

                                    $this->btnPrev = new QButton($this);

                        MissingImport

                        Since: 2.7.0

                        Importing all external classes in a file through use statements makes them clearly visible.

                        Example

                        function make() {
                            return new \stdClass();
                        }

                        Source http://phpmd.org/rules/cleancode.html#MissingImport

                        Missing class import via use statement (line '269', column '30').
                        Open

                                    $this->imgMainImage = new QImageControl($this);

                        MissingImport

                        Since: 2.7.0

                        Importing all external classes in a file through use statements makes them clearly visible.

                        Example

                        function make() {
                            return new \stdClass();
                        }

                        Source http://phpmd.org/rules/cleancode.html#MissingImport

                        Missing class import via use statement (line '80', column '16').
                        Open

                                            throw new QCallerException("QImageBrowserNav must be inside a QImageBrowser");

                        MissingImport

                        Since: 2.7.0

                        Importing all external classes in a file through use statements makes them clearly visible.

                        Example

                        function make() {
                            return new \stdClass();
                        }

                        Source http://phpmd.org/rules/cleancode.html#MissingImport

                        Missing class import via use statement (line '51', column '26').
                        Open

                                    $this->btnFirst = new QButton($this);

                        MissingImport

                        Since: 2.7.0

                        Importing all external classes in a file through use statements makes them clearly visible.

                        Example

                        function make() {
                            return new \stdClass();
                        }

                        Source http://phpmd.org/rules/cleancode.html#MissingImport

                        Missing class import via use statement (line '93', column '31').
                        Open

                                        $objButton->AddAction(new QClickEvent(), new QAjaxControlAction($objImageBrowser, $strActionCalback));

                        MissingImport

                        Since: 2.7.0

                        Importing all external classes in a file through use statements makes them clearly visible.

                        Example

                        function make() {
                            return new \stdClass();
                        }

                        Source http://phpmd.org/rules/cleancode.html#MissingImport

                        Missing class import via use statement (line '288', column '38').
                        Open

                                        $this->txtCaption->AddAction(new QChangeEvent(), new QAjaxControlAction($this, "txtCaption_Change"));

                        MissingImport

                        Since: 2.7.0

                        Importing all external classes in a file through use statements makes them clearly visible.

                        Example

                        function make() {
                            return new \stdClass();
                        }

                        Source http://phpmd.org/rules/cleancode.html#MissingImport

                        Missing class import via use statement (line '206', column '16').
                        Open

                                            throw new QCallerException("QImageBrowserThumbnails must be inside a QImageBrowser");

                        MissingImport

                        Since: 2.7.0

                        Importing all external classes in a file through use statements makes them clearly visible.

                        Example

                        function make() {
                            return new \stdClass();
                        }

                        Source http://phpmd.org/rules/cleancode.html#MissingImport

                        Missing class import via use statement (line '222', column '25').
                        Open

                                        $img->AddAction(new QClickEvent(), new QAjaxControlAction($objImageBrowser, "imgThm_Click"));

                        MissingImport

                        Since: 2.7.0

                        Importing all external classes in a file through use statements makes them clearly visible.

                        Example

                        function make() {
                            return new \stdClass();
                        }

                        Source http://phpmd.org/rules/cleancode.html#MissingImport

                        Missing class import via use statement (line '297', column '32').
                        Open

                                    $this->ibnNavigation1 = new QImageBrowserNav($this);

                        MissingImport

                        Since: 2.7.0

                        Importing all external classes in a file through use statements makes them clearly visible.

                        Example

                        function make() {
                            return new \stdClass();
                        }

                        Source http://phpmd.org/rules/cleancode.html#MissingImport

                        Missing class import via use statement (line '532', column '56').
                        Open

                                                $this->btnSave->AddAction(new QClickEvent(), new QAjaxControlAction($this, "btnSave_Click"));

                        MissingImport

                        Since: 2.7.0

                        Importing all external classes in a file through use statements makes them clearly visible.

                        Example

                        function make() {
                            return new \stdClass();
                        }

                        Source http://phpmd.org/rules/cleancode.html#MissingImport

                        The method __construct has a boolean flag argument $blnReadOnlyCaption, which is a certain sign of a Single Responsibility Principle violation.
                        Open

                                public function __construct($objParentObject, $blnReadOnlyCaption = true, $blnTwoNavBars = false, $blnThumbnails = true, $strControlId = null) {

                        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

                        Missing class import via use statement (line '293', column '54').
                        Open

                                        $this->btnSave->AddAction(new QClickEvent(), new QAjaxControlAction($this, "btnSave_Click"));

                        MissingImport

                        Since: 2.7.0

                        Importing all external classes in a file through use statements makes them clearly visible.

                        Example

                        function make() {
                            return new \stdClass();
                        }

                        Source http://phpmd.org/rules/cleancode.html#MissingImport

                        The method __construct has a boolean flag argument $blnTwoNavBars, which is a certain sign of a Single Responsibility Principle violation.
                        Open

                                public function __construct($objParentObject, $blnReadOnlyCaption = true, $blnTwoNavBars = false, $blnThumbnails = true, $strControlId = null) {

                        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

                        Missing class import via use statement (line '293', column '35').
                        Open

                                        $this->btnSave->AddAction(new QClickEvent(), new QAjaxControlAction($this, "btnSave_Click"));

                        MissingImport

                        Since: 2.7.0

                        Importing all external classes in a file through use statements makes them clearly visible.

                        Example

                        function make() {
                            return new \stdClass();
                        }

                        Source http://phpmd.org/rules/cleancode.html#MissingImport

                        Missing class import via use statement (line '61', column '25').
                        Open

                                    $this->btnNext = new QButton($this);

                        MissingImport

                        Since: 2.7.0

                        Importing all external classes in a file through use statements makes them clearly visible.

                        Example

                        function make() {
                            return new \stdClass();
                        }

                        Source http://phpmd.org/rules/cleancode.html#MissingImport

                        Missing class import via use statement (line '66', column '25').
                        Open

                                    $this->btnLast = new QButton($this);

                        MissingImport

                        Since: 2.7.0

                        Importing all external classes in a file through use statements makes them clearly visible.

                        Example

                        function make() {
                            return new \stdClass();
                        }

                        Source http://phpmd.org/rules/cleancode.html#MissingImport

                        Missing class import via use statement (line '222', column '44').
                        Open

                                        $img->AddAction(new QClickEvent(), new QAjaxControlAction($objImageBrowser, "imgThm_Click"));

                        MissingImport

                        Since: 2.7.0

                        Importing all external classes in a file through use statements makes them clearly visible.

                        Example

                        function make() {
                            return new \stdClass();
                        }

                        Source http://phpmd.org/rules/cleancode.html#MissingImport

                        Missing class import via use statement (line '566', column '15').
                        Open

                                        throw new QCallerException("$strDir is not a directory"); 

                        MissingImport

                        Since: 2.7.0

                        Importing all external classes in a file through use statements makes them clearly visible.

                        Example

                        function make() {
                            return new \stdClass();
                        }

                        Source http://phpmd.org/rules/cleancode.html#MissingImport

                        Missing class import via use statement (line '93', column '50').
                        Open

                                        $objButton->AddAction(new QClickEvent(), new QAjaxControlAction($objImageBrowser, $strActionCalback));

                        MissingImport

                        Since: 2.7.0

                        Importing all external classes in a file through use statements makes them clearly visible.

                        Example

                        function make() {
                            return new \stdClass();
                        }

                        Source http://phpmd.org/rules/cleancode.html#MissingImport

                        Missing class import via use statement (line '212', column '16').
                        Open

                                        $img = new QImageControl($this);

                        MissingImport

                        Since: 2.7.0

                        Importing all external classes in a file through use statements makes them clearly visible.

                        Example

                        function make() {
                            return new \stdClass();
                        }

                        Source http://phpmd.org/rules/cleancode.html#MissingImport

                        Missing class import via use statement (line '306', column '32').
                        Open

                                        $this->ibtThumbnails = new QImageBrowserThumbnails($this);

                        MissingImport

                        Since: 2.7.0

                        Importing all external classes in a file through use statements makes them clearly visible.

                        Example

                        function make() {
                            return new \stdClass();
                        }

                        Source http://phpmd.org/rules/cleancode.html#MissingImport

                        Missing class import via use statement (line '278', column '28').
                        Open

                                    $this->txtCaption = new QTextBox($this);

                        MissingImport

                        Since: 2.7.0

                        Importing all external classes in a file through use statements makes them clearly visible.

                        Example

                        function make() {
                            return new \stdClass();
                        }

                        Source http://phpmd.org/rules/cleancode.html#MissingImport

                        Missing class import via use statement (line '288', column '58').
                        Open

                                        $this->txtCaption->AddAction(new QChangeEvent(), new QAjaxControlAction($this, "txtCaption_Change"));

                        MissingImport

                        Since: 2.7.0

                        Importing all external classes in a file through use statements makes them clearly visible.

                        Example

                        function make() {
                            return new \stdClass();
                        }

                        Source http://phpmd.org/rules/cleancode.html#MissingImport

                        Missing class import via use statement (line '300', column '33').
                        Open

                                        $this->ibnNavigation2 = new QImageBrowserNav($this);

                        MissingImport

                        Since: 2.7.0

                        Importing all external classes in a file through use statements makes them clearly visible.

                        Example

                        function make() {
                            return new \stdClass();
                        }

                        Source http://phpmd.org/rules/cleancode.html#MissingImport

                        Missing class import via use statement (line '571', column '15').
                        Open

                                        throw new QCallerException("Could not open directory $strDir");

                        MissingImport

                        Since: 2.7.0

                        Importing all external classes in a file through use statements makes them clearly visible.

                        Example

                        function make() {
                            return new \stdClass();
                        }

                        Source http://phpmd.org/rules/cleancode.html#MissingImport

                        The method __construct has a boolean flag argument $blnThumbnails, which is a certain sign of a Single Responsibility Principle violation.
                        Open

                                public function __construct($objParentObject, $blnReadOnlyCaption = true, $blnTwoNavBars = false, $blnThumbnails = true, $strControlId = null) {

                        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

                        Missing class import via use statement (line '290', column '26').
                        Open

                                        $this->btnSave = new QButton($this);

                        MissingImport

                        Since: 2.7.0

                        Importing all external classes in a file through use statements makes them clearly visible.

                        Example

                        function make() {
                            return new \stdClass();
                        }

                        Source http://phpmd.org/rules/cleancode.html#MissingImport

                        Missing class import via use statement (line '532', column '37').
                        Open

                                                $this->btnSave->AddAction(new QClickEvent(), new QAjaxControlAction($this, "btnSave_Click"));

                        MissingImport

                        Since: 2.7.0

                        Importing all external classes in a file through use statements makes them clearly visible.

                        Example

                        function make() {
                            return new \stdClass();
                        }

                        Source http://phpmd.org/rules/cleancode.html#MissingImport

                        Avoid using static access to class 'QType' in method '__set'.
                        Open

                                                $this->btnNext = QType::Cast($mixValue, 'QControl');

                        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 '__construct'.
                        Open

                                        $this->btnSave->Text = QApplication::Translate('Save');

                        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->ibnNavigation1 = QType::Cast($mixValue, 'QImageBrowserNav');

                        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->arrImagePaths = QType::Cast($mixValue, QType::ArrayType);

                        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 '__construct'.
                        Open

                                    $this->btnFirst->Text = QApplication::Translate('First');

                        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 'reload'.
                        Open

                                        $this->Text = QApplication::Translate('No thumbnails');

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

                                    } else {
                                        $this->Text = QApplication::Translate('No thumbnails');
                                    }

                        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->ibnNavigation2 = QType::Cast($mixValue, 'QImageBrowserNav');

                        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->btnFirst = QType::Cast($mixValue, 'QControl');

                        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 assigning values to variables in if clauses and the like (line '610', column '19').
                        Open

                                protected function loadCaption($intIdx) {
                                    $strCaptionFile = $this->captionFileName($intIdx);
                                    if (!file_exists($strCaptionFile)) {
                                        //return $strCaptionFile;
                                        return '';

                        IfStatementAssignment

                        Since: 2.7.0

                        Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

                        Example

                        class Foo
                        {
                            public function bar($flag)
                            {
                                if ($foo = 'bar') { // possible typo
                                    // ...
                                }
                                if ($baz = 0) { // always false
                                    // ...
                                }
                            }
                        }

                        Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

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

                                    } else {
                                        $this->txtCaption->CssClass = 'textbox ib_caption';
                                        $this->txtCaption->AddAction(new QChangeEvent(), new QAjaxControlAction($this, "txtCaption_Change"));
                        
                                        $this->btnSave = new QButton($this);

                        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->btnLast = QType::Cast($mixValue, 'QControl');

                        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->txtCaption = QType::Cast($mixValue, 'QControl');

                        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 '__construct'.
                        Open

                                    $this->btnPrev->Text = QApplication::Translate('Previous');

                        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 '__construct'.
                        Open

                                    $this->btnLast->Text = QApplication::Translate('Last');

                        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->ibtThumbnails = QType::Cast($mixValue, 'QImageBrowserThumbnails');

                        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->btnPrev = QType::Cast($mixValue, 'QControl');

                        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->btnSave = QType::Cast($mixValue, 'QControl');

                        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 '__construct'.
                        Open

                                    $this->btnNext->Text = QApplication::Translate('Next');

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

                                                } else {
                                                    $ctrl->RemoveCssClass($this->selectThumbnailCssClass());
                                                }

                        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 unused parameters such as '$strParameter'.
                        Open

                                public function btnNext_Click($strFormId, $strControlId, $strParameter) {

                        UnusedFormalParameter

                        Since: 0.2

                        Avoid passing parameters to methods or constructors and then not using those parameters.

                        Example

                        class Foo
                        {
                            private function bar($howdy)
                            {
                                // $howdy is not used
                            }
                        }

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

                        Avoid unused parameters such as '$strFormId'.
                        Open

                                public function btnFirst_Click($strFormId, $strControlId, $strParameter) {

                        UnusedFormalParameter

                        Since: 0.2

                        Avoid passing parameters to methods or constructors and then not using those parameters.

                        Example

                        class Foo
                        {
                            private function bar($howdy)
                            {
                                // $howdy is not used
                            }
                        }

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

                        Avoid unused parameters such as '$strControlId'.
                        Open

                                public function btnLast_Click($strFormId, $strControlId, $strParameter) {

                        UnusedFormalParameter

                        Since: 0.2

                        Avoid passing parameters to methods or constructors and then not using those parameters.

                        Example

                        class Foo
                        {
                            private function bar($howdy)
                            {
                                // $howdy is not used
                            }
                        }

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

                        Avoid unused parameters such as '$strFormId'.
                        Open

                                public function imgThm_Click($strFormId, $strControlId, $strParameter) {

                        UnusedFormalParameter

                        Since: 0.2

                        Avoid passing parameters to methods or constructors and then not using those parameters.

                        Example

                        class Foo
                        {
                            private function bar($howdy)
                            {
                                // $howdy is not used
                            }
                        }

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

                        Avoid unused parameters such as '$strParameter'.
                        Open

                                public function txtCaption_Change($strFormId, $strControlId, $strParameter) {

                        UnusedFormalParameter

                        Since: 0.2

                        Avoid passing parameters to methods or constructors and then not using those parameters.

                        Example

                        class Foo
                        {
                            private function bar($howdy)
                            {
                                // $howdy is not used
                            }
                        }

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

                        Avoid unused parameters such as '$strFormId'.
                        Open

                                public function btnNext_Click($strFormId, $strControlId, $strParameter) {

                        UnusedFormalParameter

                        Since: 0.2

                        Avoid passing parameters to methods or constructors and then not using those parameters.

                        Example

                        class Foo
                        {
                            private function bar($howdy)
                            {
                                // $howdy is not used
                            }
                        }

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

                        Avoid unused parameters such as '$strControlId'.
                        Open

                                public function btnNext_Click($strFormId, $strControlId, $strParameter) {

                        UnusedFormalParameter

                        Since: 0.2

                        Avoid passing parameters to methods or constructors and then not using those parameters.

                        Example

                        class Foo
                        {
                            private function bar($howdy)
                            {
                                // $howdy is not used
                            }
                        }

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

                        Avoid unused parameters such as '$strControlId'.
                        Open

                                public function btnPrev_Click($strFormId, $strControlId, $strParameter) {

                        UnusedFormalParameter

                        Since: 0.2

                        Avoid passing parameters to methods or constructors and then not using those parameters.

                        Example

                        class Foo
                        {
                            private function bar($howdy)
                            {
                                // $howdy is not used
                            }
                        }

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

                        Avoid unused parameters such as '$strControlId'.
                        Open

                                public function btnSave_Click($strFormId, $strControlId, $strParameter) {

                        UnusedFormalParameter

                        Since: 0.2

                        Avoid passing parameters to methods or constructors and then not using those parameters.

                        Example

                        class Foo
                        {
                            private function bar($howdy)
                            {
                                // $howdy is not used
                            }
                        }

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

                        Avoid unused parameters such as '$strParameter'.
                        Open

                                public function btnPrev_Click($strFormId, $strControlId, $strParameter) {

                        UnusedFormalParameter

                        Since: 0.2

                        Avoid passing parameters to methods or constructors and then not using those parameters.

                        Example

                        class Foo
                        {
                            private function bar($howdy)
                            {
                                // $howdy is not used
                            }
                        }

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

                        Avoid unused parameters such as '$strParameter'.
                        Open

                                public function btnLast_Click($strFormId, $strControlId, $strParameter) {

                        UnusedFormalParameter

                        Since: 0.2

                        Avoid passing parameters to methods or constructors and then not using those parameters.

                        Example

                        class Foo
                        {
                            private function bar($howdy)
                            {
                                // $howdy is not used
                            }
                        }

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

                        Avoid unused parameters such as '$strControlId'.
                        Open

                                public function txtCaption_Change($strFormId, $strControlId, $strParameter) {

                        UnusedFormalParameter

                        Since: 0.2

                        Avoid passing parameters to methods or constructors and then not using those parameters.

                        Example

                        class Foo
                        {
                            private function bar($howdy)
                            {
                                // $howdy is not used
                            }
                        }

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

                        Avoid unused parameters such as '$strFormId'.
                        Open

                                public function btnLast_Click($strFormId, $strControlId, $strParameter) {

                        UnusedFormalParameter

                        Since: 0.2

                        Avoid passing parameters to methods or constructors and then not using those parameters.

                        Example

                        class Foo
                        {
                            private function bar($howdy)
                            {
                                // $howdy is not used
                            }
                        }

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

                        Avoid unused parameters such as '$strFormId'.
                        Open

                                public function txtCaption_Change($strFormId, $strControlId, $strParameter) {

                        UnusedFormalParameter

                        Since: 0.2

                        Avoid passing parameters to methods or constructors and then not using those parameters.

                        Example

                        class Foo
                        {
                            private function bar($howdy)
                            {
                                // $howdy is not used
                            }
                        }

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

                        Avoid unused parameters such as '$strFormId'.
                        Open

                                public function btnPrev_Click($strFormId, $strControlId, $strParameter) {

                        UnusedFormalParameter

                        Since: 0.2

                        Avoid passing parameters to methods or constructors and then not using those parameters.

                        Example

                        class Foo
                        {
                            private function bar($howdy)
                            {
                                // $howdy is not used
                            }
                        }

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

                        Avoid unused parameters such as '$strParameter'.
                        Open

                                public function btnSave_Click($strFormId, $strControlId, $strParameter) {

                        UnusedFormalParameter

                        Since: 0.2

                        Avoid passing parameters to methods or constructors and then not using those parameters.

                        Example

                        class Foo
                        {
                            private function bar($howdy)
                            {
                                // $howdy is not used
                            }
                        }

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

                        Avoid unused parameters such as '$strParameter'.
                        Open

                                public function btnFirst_Click($strFormId, $strControlId, $strParameter) {

                        UnusedFormalParameter

                        Since: 0.2

                        Avoid passing parameters to methods or constructors and then not using those parameters.

                        Example

                        class Foo
                        {
                            private function bar($howdy)
                            {
                                // $howdy is not used
                            }
                        }

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

                        Avoid unused parameters such as '$strControlId'.
                        Open

                                public function imgThm_Click($strFormId, $strControlId, $strParameter) {

                        UnusedFormalParameter

                        Since: 0.2

                        Avoid passing parameters to methods or constructors and then not using those parameters.

                        Example

                        class Foo
                        {
                            private function bar($howdy)
                            {
                                // $howdy is not used
                            }
                        }

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

                        Avoid unused parameters such as '$strFormId'.
                        Open

                                public function btnSave_Click($strFormId, $strControlId, $strParameter) {

                        UnusedFormalParameter

                        Since: 0.2

                        Avoid passing parameters to methods or constructors and then not using those parameters.

                        Example

                        class Foo
                        {
                            private function bar($howdy)
                            {
                                // $howdy is not used
                            }
                        }

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

                        Avoid unused parameters such as '$strControlId'.
                        Open

                                public function btnFirst_Click($strFormId, $strControlId, $strParameter) {

                        UnusedFormalParameter

                        Since: 0.2

                        Avoid passing parameters to methods or constructors and then not using those parameters.

                        Example

                        class Foo
                        {
                            private function bar($howdy)
                            {
                                // $howdy is not used
                            }
                        }

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

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

                                public function __get($strName) {
                                    switch ($strName) {
                                        case "MainImage": return $this->imgMainImage;
                                        case "Caption": return $this->txtCaption;
                                        case "SaveButton": return $this->btnSave;
                        Severity: Major
                        Found in includes/base_controls/QImageBrowser.class.php and 3 other locations - About 50 mins to fix
                        includes/base_controls/QFormBase.class.php on lines 111..128
                        includes/base_controls/QMenuGen.class.php on lines 389..405
                        includes/base_controls/QNumericTextBox.class.php on lines 126..150

                        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 97.

                        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 $blnBackButtonsEnabled. Keep variable name length under 20.
                        Open

                                    $blnBackButtonsEnabled = $intCount > 1 && $intIdx > 0;

                        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 $blnForwardButtonsEnabled. Keep variable name length under 20.
                        Open

                                    $blnForwardButtonsEnabled = $intCount > 1 && $intIdx+1 < $intCount;

                        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 variables with short names like $dh. Configured minimum length is 3.
                        Open

                                    $dh = opendir($strDir);

                        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

                        The method ImagePath is not named in camelCase.
                        Open

                                abstract public function ImagePath($intIdx);    

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

                                public function ImagePath($intIdx) {
                                    return $this->arrImagePaths[$intIdx];
                                }

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

                                public function btnFirst_Click($strFormId, $strControlId, $strParameter) {
                                    $this->setMainImage(0);
                                }

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

                                public function btnNext_Click($strFormId, $strControlId, $strParameter) {
                                    if (!is_null($this->intCurrentImage)) {
                                        $this->setMainImage($this->intCurrentImage + 1);
                                    }
                                }

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

                                public function LoadImagesFromDirectory($strDir, $strPattern) {
                                    if (!is_dir($strDir)) {
                                        throw new QCallerException("$strDir is not a directory"); 
                                    }
                        
                        

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

                                public function ForwardButtonsEnabled($blnEnable) {
                                    $this->btnNext->Enabled = $blnEnable;
                                    $this->btnLast->Enabled = $blnEnable;
                                }

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

                                public function imgThm_Click($strFormId, $strControlId, $strParameter) {
                                    $this->setMainImage($strParameter);
                                }

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

                                public function ImageCount() {
                                    if (!$this->arrImagePaths) return 0;
                                    return count($this->arrImagePaths);
                                }

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

                                public function btnLast_Click($strFormId, $strControlId, $strParameter) {
                                    $this->setMainImage($this->ImageCount()-1);
                                }

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

                                public function txtCaption_Change($strFormId, $strControlId, $strParameter) {
                                    if ($this->btnSave) {
                                        $this->btnSave->Enabled = !is_null($this->intCurrentImage);
                                    }
                                }

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

                                public function BackButtonsEnabled($blnEnable) {
                                    $this->btnFirst->Enabled = $blnEnable;
                                    $this->btnPrev->Enabled = $blnEnable;
                                }

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

                                public function btnSave_Click($strFormId, $strControlId, $strParameter) {
                                    $this->saveCaption($this->intCurrentImage, $this->txtCaption->Text);
                                    if ($this->btnSave) {
                                        $this->btnSave->Enabled = 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 ThumbnailImagePath is not named in camelCase.
                        Open

                                public function ThumbnailImagePath($intIdx) {
                                    return $this->ImagePath($intIdx);
                                }

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

                                abstract public function ThumbnailImagePath($intIdx);

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

                                abstract public function ImageCount();

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

                                public function btnPrev_Click($strFormId, $strControlId, $strParameter) {
                                    if (!is_null($this->intCurrentImage)) {
                                        $this->setMainImage($this->intCurrentImage - 1);
                                    }
                                }

                        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