codeformunich/Muenchen-Transparent

View on GitHub
protected/controllers/IndexController.php

Summary

Maintainability
F
4 days
Test Coverage

The method IndexController::actionTileCache() calls the typical debug function var_dump() which is mostly only used during development.
Open

            var_dump($ch);

DevelopmentCodeFragment

Since: 2.3.0

Functions like vardump(), printr() etc. are normally only used during development and therefore such calls in production code are a good indicator that they were just forgotten.

Example

class SuspectCode {

    public function doSomething(array $items)
    {
        foreach ($items as $i => $item) {
            // …

            if ('qafoo' == $item) var_dump($i);

            // …
        }
    }
}

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

File IndexController.php has 774 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

class IndexController extends RISBaseController
{
    public static $BA_DOKUMENTE_TAGE_PRO_SEITE = 14;
Severity: Major
Found in protected/controllers/IndexController.php - About 1 day to fix

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

    class IndexController extends RISBaseController
    {
        public static $BA_DOKUMENTE_TAGE_PRO_SEITE = 14;
    
        /**

    The class IndexController has 19 public methods. Consider refactoring IndexController to keep number of public methods under 10.
    Open

    class IndexController extends RISBaseController
    {
        public static $BA_DOKUMENTE_TAGE_PRO_SEITE = 14;
    
        /**

    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

    IndexController has 26 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class IndexController extends RISBaseController
    {
        public static $BA_DOKUMENTE_TAGE_PRO_SEITE = 14;
    
        /**
    Severity: Minor
    Found in protected/controllers/IndexController.php - About 3 hrs to fix

      Method actionGeojsonSuche has 77 lines of code (exceeds 30 allowed). Consider refactoring.
      Open

          public function actionGeojsonSuche()
          {
              $krits = new RISSucheKrits();
      
              $solr   = RISSolrHelper::getSolrClient();
      Severity: Major
      Found in protected/controllers/IndexController.php - About 2 hrs to fix

        Method actionSuche has 63 lines of code (exceeds 30 allowed). Consider refactoring.
        Open

            public function actionSuche($code = "")
            {
                if (AntiXSS::isTokenSet("search_form")) {
                    $krits = new RISSucheKrits();
                    if (trim($_REQUEST["volltext"]) != "")  $krits->addKrit('volltext',   $_REQUEST["volltext"]);
        Severity: Major
        Found in protected/controllers/IndexController.php - About 2 hrs to fix

          Method actionTileCache has 58 lines of code (exceeds 30 allowed). Consider refactoring.
          Open

              public function actionTileCache($width, $zoom, $x, $y)
              {
          
                  if ($width == 256) {
                      $boundaries = [
          Severity: Major
          Found in protected/controllers/IndexController.php - About 2 hrs to fix

            Method extractAvailalbleFacets has 57 lines of code (exceeds 30 allowed). Consider refactoring.
            Open

                private function extractAvailalbleFacets($ergebnisse, $krits, $facet_field_names) {
                    $availalbe_facets = [];
                    $used_factes      = [];
            
                    foreach ($facet_field_names as $facet_field_name) {
            Severity: Major
            Found in protected/controllers/IndexController.php - About 2 hrs to fix

              Method actionAntraegeAjaxGeo has 53 lines of code (exceeds 30 allowed). Consider refactoring.
              Open

                  public function actionAntraegeAjaxGeo($lat, $lng, $radius, $seite = 0)
                  {
                      $krits = new RISSucheKrits();
                      $krits->addKrit('geo', $lng . '-' . $lat . '-' . $radius);
              
              
              Severity: Major
              Found in protected/controllers/IndexController.php - About 1 hr to fix

                Method sucheBenachrichtigungenAnmelden has 48 lines of code (exceeds 30 allowed). Consider refactoring.
                Open

                    protected function sucheBenachrichtigungenAnmelden($curr_krits, $code)
                    {
                        $user = Yii::app()->getUser();
                
                        $correct_person      = null;
                Severity: Minor
                Found in protected/controllers/IndexController.php - About 1 hr to fix

                  Method getJSGeodata has 40 lines of code (exceeds 30 allowed). Consider refactoring.
                  Open

                      protected function getJSGeodata($krits, $ergebnisse)
                      {
                          $geo = $krits->getGeoKrit();
                          /** @var RISSolrDocument[] $solr_dokumente */
                          $solr_dokumente = $ergebnisse->getDocuments();
                  Severity: Minor
                  Found in protected/controllers/IndexController.php - About 1 hr to fix

                    Method ba_dokumente_nach_datum has 39 lines of code (exceeds 30 allowed). Consider refactoring.
                    Open

                        private function ba_dokumente_nach_datum($ba_nr, $datum_max, $tage = null)
                        {
                            if ($tage === null) $tage = static::$BA_DOKUMENTE_TAGE_PRO_SEITE;
                    
                            if (preg_match("/^[0-9]{4}\-[0-9]{2}\-[0-9]{2}$/siu", $datum_max)) {
                    Severity: Minor
                    Found in protected/controllers/IndexController.php - About 1 hr to fix

                      Avoid too many return statements within this method.
                      Open

                              return [
                                  "datum_von"        => $datum_von,
                                  "datum_bis"        => $datum_bis,
                                  "aeltere_url_std"  => $aeltere_url_std,
                                  "neuere_url_std"   => $neuere_url_std,
                      Severity: Major
                      Found in protected/controllers/IndexController.php - About 30 mins to fix

                        The method actionTileCache() has an NPath complexity of 240. The configured NPath complexity threshold is 200.
                        Open

                            public function actionTileCache($width, $zoom, $x, $y)
                            {
                        
                                if ($width == 256) {
                                    $boundaries = [

                        NPathComplexity

                        Since: 0.1

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

                        Example

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

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

                        The method actionGeojsonSuche() has an NPath complexity of 3600. The configured NPath complexity threshold is 200.
                        Open

                            public function actionGeojsonSuche()
                            {
                                $krits = new RISSucheKrits();
                        
                                $solr   = RISSolrHelper::getSolrClient();

                        NPathComplexity

                        Since: 0.1

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

                        Example

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

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

                        The class IndexController has 1034 lines of code. Current threshold is 1000. Avoid really long classes.
                        Open

                        class IndexController extends RISBaseController
                        {
                            public static $BA_DOKUMENTE_TAGE_PRO_SEITE = 14;
                        
                            /**

                        The method actionSuche() has an NPath complexity of 340. The configured NPath complexity threshold is 200.
                        Open

                            public function actionSuche($code = "")
                            {
                                if (AntiXSS::isTokenSet("search_form")) {
                                    $krits = new RISSucheKrits();
                                    if (trim($_REQUEST["volltext"]) != "")  $krits->addKrit('volltext',   $_REQUEST["volltext"]);

                        NPathComplexity

                        Since: 0.1

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

                        Example

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

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

                        The method extractAvailalbleFacets() has an NPath complexity of 289. The configured NPath complexity threshold is 200.
                        Open

                            private function extractAvailalbleFacets($ergebnisse, $krits, $facet_field_names) {
                                $availalbe_facets = [];
                                $used_factes      = [];
                        
                                foreach ($facet_field_names as $facet_field_name) {

                        NPathComplexity

                        Since: 0.1

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

                        Example

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

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

                        The method ba_dokumente_nach_datum() has an NPath complexity of 288. The configured NPath complexity threshold is 200.
                        Open

                            private function ba_dokumente_nach_datum($ba_nr, $datum_max, $tage = null)
                            {
                                if ($tage === null) $tage = static::$BA_DOKUMENTE_TAGE_PRO_SEITE;
                        
                                if (preg_match("/^[0-9]{4}\-[0-9]{2}\-[0-9]{2}$/siu", $datum_max)) {

                        NPathComplexity

                        Since: 0.1

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

                        Example

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

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

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

                            private function ba_dokumente_nach_datum($ba_nr, $datum_max, $tage = null)
                            {
                                if ($tage === null) $tage = static::$BA_DOKUMENTE_TAGE_PRO_SEITE;
                        
                                if (preg_match("/^[0-9]{4}\-[0-9]{2}\-[0-9]{2}$/siu", $datum_max)) {

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

                            public function actionGeojsonSuche()
                            {
                                $krits = new RISSucheKrits();
                        
                                $solr   = RISSolrHelper::getSolrClient();

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

                            private function extractAvailalbleFacets($ergebnisse, $krits, $facet_field_names) {
                                $availalbe_facets = [];
                                $used_factes      = [];
                        
                                foreach ($facet_field_names as $facet_field_name) {

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

                            public function actionSuche($code = "")
                            {
                                if (AntiXSS::isTokenSet("search_form")) {
                                    $krits = new RISSucheKrits();
                                    if (trim($_REQUEST["volltext"]) != "")  $krits->addKrit('volltext',   $_REQUEST["volltext"]);

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

                            public function actionTileCache($width, $zoom, $x, $y)
                            {
                        
                                if ($width == 256) {
                                    $boundaries = [

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

                            protected function dokumente2geodata(&$dokumente, $filter_krits = null)
                            {
                                $geodata = [];
                                foreach ($dokumente as $dokument) {
                                    if ($dokument->antrag) {

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

                            protected function antraege2geodata(&$antraege, $typ = 0)
                            {
                                $geodata          = $geodata_overflow = [];
                                $geodata_nach_dok = [];
                                foreach ($antraege as $ant) {

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

                        class IndexController extends RISBaseController
                        {
                            public static $BA_DOKUMENTE_TAGE_PRO_SEITE = 14;
                        
                            /**

                        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

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

                                $krits = new RISSucheKrits();

                        UnusedLocalVariable

                        Since: 0.2

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

                        Example

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

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

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

                                list($antraege, $antraege_stadtrat, $antraege_sonstige, $datum_von, $datum_bis) = $this->getStadtratsDokumenteByDate($time);

                        UnusedLocalVariable

                        Since: 0.2

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

                        Example

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

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

                        Avoid unused parameters such as '$code'.
                        Open

                            protected function sucheBenachrichtigungenAnmelden($curr_krits, $code)

                        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 local variables such as '$antraege_sonstige'.
                        Open

                                list($antraege, $antraege_stadtrat, $antraege_sonstige, $datum_von, $datum_bis) = $this->getStadtratsDokumenteByDate($time);

                        UnusedLocalVariable

                        Since: 0.2

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

                        Example

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

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

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

                                list($antraege, $antraege_stadtrat, $antraege_sonstige, $datum_von, $datum_bis) = $this->getStadtratsDokumenteByDate($time);

                        UnusedLocalVariable

                        Since: 0.2

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

                        Example

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

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

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

                                $correct_person      = null;

                        UnusedLocalVariable

                        Since: 0.2

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

                        Example

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

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

                        The method actionGeojsonSuche() contains an exit expression.
                        Open

                                    die();

                        ExitExpression

                        Since: 0.2

                        An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

                        Example

                        class Foo {
                            public function bar($param)  {
                                if ($param === 42) {
                                    exit(23);
                                }
                            }
                        }

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

                        Avoid using count() function in do loops.
                        Open

                                do {
                                    if ($heute) {
                                        $datum_von = date("Y-m-d", $date_ts - 3600 * 24 * $i) . " 00:00:00";
                                        $datum_bis = date("Y-m-d H:i:s");
                                    } else {

                        CountInLoopExpression

                        Since: 2.7.0

                        Using count/sizeof in loops expressions is considered bad practice and is a potential source of many bugs, especially when the loop manipulates an array, as count happens on each iteration.

                        Example

                        class Foo {
                        
                          public function bar()
                          {
                            $array = array();
                        
                            for ($i = 0; count($array); $i++) {
                              // ...
                            }
                          }
                        }

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

                        TODO found
                        Open

                                     * @TODO: Setzt voraus: offizielles Datum eines Dokuments ermitteln

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

                            public static $BA_DOKUMENTE_TAGE_PRO_SEITE = 14;

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

                                $do_benachrichtigung_add = AntiXSS::isTokenSet("benachrichtigung_add"); // Token ändert sich möglicherweise beim Login

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

                                $do_benachrichtigung_del = AntiXSS::isTokenSet("benachrichtigung_del");

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

                                    $benachrichtigungen_optionen = $this->sucheBenachrichtigungenAnmelden($krits, $code);

                        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

                        There are no issues that match your filters.

                        Category
                        Status