codeformunich/Muenchen-Transparent

View on GitHub

Showing 1,630 of 1,630 total issues

Method parse has 81 lines of code (exceeds 30 allowed). Consider refactoring.
Open

    public function parse(int $id): ?Antrag
    {
        if (SITE_CALL_MODE != "cron") echo "- Antrag $id\n";

        $html = $this->curlBasedDownloader->loadUrl(RIS_URL_PREFIX . 'antrag/detail/' . $id);
Severity: Major
Found in protected/RISParser/BAAntragParser.php - About 3 hrs to fix

    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 korrigiereDokumentenTitel has 80 lines of code (exceeds 30 allowed). Consider refactoring.
      Open

          public static function korrigiereDokumentenTitel($titel)
          {
              $titel = trim(str_replace("_", " ", $titel));
      
              if (preg_match("/^[0-9]+to[0-9]+$/siu", $titel)) {
      Severity: Major
      Found in protected/components/RISTools.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 benachrichtigungsErgebnisse has 77 lines of code (exceeds 30 allowed). Consider refactoring.
          Open

              #[ArrayShape(["antraege" => "array", "termine" => "array", "vorgaenge" => "array"])]
              public function benachrichtigungsErgebnisse(int $zeitspanne): array
              {
                  $benachrichtigungen = $this->getBenachrichtigungen();
          
          
          Severity: Major
          Found in protected/models/BenutzerIn.php - About 2 hrs to fix

            Method parse has 76 lines of code (exceeds 30 allowed). Consider refactoring.
            Open

                public function parse(int $id): ?Antrag
                {
                    if (SITE_CALL_MODE != "cron") echo "- Initiative $id\n";
            
                    $html = $this->curlBasedDownloader->loadUrl(RIS_URL_PREFIX . 'antrag/detail/' . $id);
            Severity: Major
            Found in protected/RISParser/BAInitiativeParser.php - About 2 hrs to fix

              Method parseFromHtml has 74 lines of code (exceeds 30 allowed). Consider refactoring.
              Open

                  public static function parseFromHtml(string $html): ?self
                  {
                      if (!preg_match('/<section class="card">.*<div><h2>Betreff<\/h2><\/div>.*<div class="card-body">\s*<div[^>]*>(?<title>[^<]*)<\/div>/siuU', $html, $match)) {
                          throw new ParsingException('Not found: title');
                      }
              Severity: Major
              Found in protected/RISParser/StadtratsvorlageData.php - About 2 hrs to fix

                Method parseFromHtml has 69 lines of code (exceeds 30 allowed). Consider refactoring.
                Open

                    public static function parseFromHtml(string $html, int $id): ?self
                    {
                        if (!preg_match('/<h1[^>]*>\s*<span[^>]*>(?<date>[^<]*)<span[^>]*><span[^>]*>(?<status>[^>]*)<\/span>/siuU', $html, $match)) {
                            throw new ParsingException('Not found: date/status');
                        }
                Severity: Major
                Found in protected/RISParser/CalendarData.php - About 2 hrs to fix

                  Termin has 23 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class Termin extends CActiveRecord implements IRISItemHasDocuments
                  {
                      public const CANCELED_STR = 'Entfällt';
                  
                      public const TYP_AUTO = 0;
                  Severity: Minor
                  Found in protected/models/Termin.php - About 2 hrs to fix

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

                    <?php
                    
                    class Reindex_BA_GremienCommand extends CConsoleCommand
                    {
                        public function run($args)
                    Severity: Major
                    Found in protected/commands/Reindex_BA_GremienCommand.php and 1 other location - About 2 hrs to fix
                    protected/commands/Reindex_BA_MitgliedCommand.php on lines 1..17

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

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

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

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

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

                    Refactorings

                    Further Reading

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

                    <?php
                    
                    class Reindex_BA_MitgliedCommand extends CConsoleCommand
                    {
                        public function run($args)
                    Severity: Major
                    Found in protected/commands/Reindex_BA_MitgliedCommand.php and 1 other location - About 2 hrs to fix
                    protected/commands/Reindex_BA_GremienCommand.php on lines 1..18

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

                    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

                    Method actionFraktionantraege has 65 lines of code (exceeds 30 allowed). Consider refactoring.
                    Open

                        public function actionFraktionantraege($fraktion_id, $limit = 30, $offset = 0) {
                            Header("Content-Type: application/json; charset=UTF-8");
                    
                            /** @var Fraktion $fraktion */
                            $fraktion = Fraktion::model()->findByPk( $fraktion_id );
                    Severity: Major
                    Found in protected/controllers/ExportController.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

                        Function input has 61 lines of code (exceeds 30 allowed). Consider refactoring.
                        Open

                            "input": function(selector) {
                              $((selector) ? selector : this.options.inputElements)
                              .filter(":notmdproc")
                              .data("mdproc", true)
                              .each( function() {
                        Severity: Major
                        Found in html/js/material/material.js - About 2 hrs to fix

                          File StadtraetIn.php has 260 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          <?php
                          
                          /**
                           * @property integer $id
                           * @property integer $referentIn
                          Severity: Minor
                          Found in protected/models/StadtraetIn.php - About 2 hrs to fix

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

                                    for ($i = 0; $i < count($matches['id']); $i++) {
                                        $link = new DokumentLink();
                                        $link->filename = $matches['filename'][$i];
                                        $link->title = $matches['title'][$i];
                                        $link->id = intval($matches['id'][$i]);
                            Severity: Major
                            Found in protected/RISParser/StadtratsvorlageData.php and 2 other locations - About 2 hrs to fix
                            protected/RISParser/AntragData.php on lines 131..138
                            protected/RISParser/CalendarData.php on lines 107..114

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                                    for ($i = 0; $i < count($matches['id']); $i++) {
                                        $link = new DokumentLink();
                                        $link->filename = $matches['filename'][$i];
                                        $link->title = $matches['title'][$i];
                                        $link->id = intval($matches['id'][$i]);
                            Severity: Major
                            Found in protected/RISParser/AntragData.php and 2 other locations - About 2 hrs to fix
                            protected/RISParser/CalendarData.php on lines 107..114
                            protected/RISParser/StadtratsvorlageData.php on lines 104..111

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                                        for ($i = 0; $i < count($matches['id']); $i++) {
                                            $link = new DokumentLink();
                                            $link->filename = $matches['filename'][$i];
                                            $link->title = $matches['title'][$i];
                                            $link->id = intval($matches['id'][$i]);
                            Severity: Major
                            Found in protected/RISParser/CalendarData.php and 2 other locations - About 2 hrs to fix
                            protected/RISParser/AntragData.php on lines 131..138
                            protected/RISParser/StadtratsvorlageData.php on lines 104..111

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

                            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

                            File Termin.php has 259 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            <?php
                            
                            /**
                             * This is the model class for table "termine".
                             *
                            Severity: Minor
                            Found in protected/models/Termin.php - About 2 hrs to fix

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

                                          if (options.text != "") div.innerHTML = '<img src="' + iconurl + '" class="leaflet-marker-icon" alt="Icon" style="' + iconsize_style + '"><div class="text">' + options.text + '</div>';
                                          else div.innerHTML = '<img src="' + iconurl + '" class="leaflet-marker-icon" alt="Icon" style="' + iconsize_style + '">';
                              Severity: Major
                              Found in html/js/leaflet.textmarkers_top.js and 1 other location - About 2 hrs to fix
                              html/js/leaflet.textmarkers.js on lines 48..49

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

                              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

                              Severity
                              Category
                              Status
                              Source
                              Language