codeformunich/Muenchen-Transparent

View on GitHub

Showing 1,630 of 1,630 total issues

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

        if ($alter_eintrag) {
            $changed = false;
            if ($alter_eintrag->name != $daten->name) $aenderungen .= "Name: " . $alter_eintrag->name . " => " . $daten->name . "\n";
            if ($alter_eintrag->kuerzel != $daten->kuerzel) $aenderungen .= "Kürzel: " . $alter_eintrag->kuerzel . " => " . $daten->kuerzel . "\n";
            if ($alter_eintrag->gremientyp != $daten->gremientyp) $aenderungen .= "Gremientyp: " . $alter_eintrag->gremientyp . " => " . $daten->gremientyp . "\n";
Severity: Major
Found in protected/RISParser/StadtratGremiumParser.php and 1 other location - About 5 hrs to fix
protected/RISParser/BAGremienParser.php on lines 30..40

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

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

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

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

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

      Ripples.prototype.getRelX = function($wrapper,  event) {
        var wrapperOffset = $wrapper.offset();
    
        if(!self.isTouch()) {
          /**
    Severity: Major
    Found in html/js/material/ripples.js and 1 other location - About 5 hrs to fix
    html/js/material/ripples.js on lines 188..209

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

    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

      Ripples.prototype.getRelY = function($wrapper, event) {
        var wrapperOffset = $wrapper.offset();
    
        if(!self.isTouch()) {
          /**
    Severity: Major
    Found in html/js/material/ripples.js and 1 other location - About 5 hrs to fix
    html/js/material/ripples.js on lines 161..182

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

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

        public function parse($gremien_id, $wahlperiode_id = 0): ?Gremium
        {
            $wahlperiode_id = IntVal($wahlperiode_id > 0 ? $wahlperiode_id : static::$WAHLPERIODE_ID);
            $gremien_id     = IntVal($gremien_id);
            if (SITE_CALL_MODE != "cron") echo "- Gremium $gremien_id\n";
    Severity: Major
    Found in protected/RISParser/BAGremienParser.php - About 4 hrs to fix

      File OParl10Object.php has 364 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      /**
       * Enthält die Funktionen zum Erzeugen alle OParl-Objekte. Der Zugriff auf die Objekte wird durch die get()-Methode
       * abstrahiert.
      Severity: Minor
      Found in protected/components/OParl10Object.php - About 4 hrs to fix

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

                _getIconUrl: function (name) {
                    var key = name + 'Url';
        
                    if (this.options[key]) {
                        return this.options[key];
        Severity: Major
        Found in html/js/leaflet.textmarkers.js and 1 other location - About 4 hrs to fix
        html/js/leaflet.textmarkers_top.js on lines 17..35

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

        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

                _getIconShadowUrl: function (name) {
                    var key = name + 'Url';
        
                    if (this.options[key]) {
                        return this.options[key];
        Severity: Major
        Found in html/js/leaflet.textmarkers_top.js and 1 other location - About 4 hrs to fix
        html/js/leaflet.textmarkers.js on lines 17..35

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

        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 RISSucheKrits.php has 360 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        class RISSucheKrits
        {
            /** @var array */
        Severity: Minor
        Found in protected/components/RISSucheKrits.php - About 4 hrs to fix

          File RISTools.php has 356 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          use Laminas\Mail\Message;
          
          class RISTools
          Severity: Minor
          Found in protected/components/RISTools.php - About 4 hrs to fix

            File BenutzerIn.php has 355 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            
            use JetBrains\PhpStorm\ArrayShape;
            
            /**
            Severity: Minor
            Found in protected/models/BenutzerIn.php - About 4 hrs to fix

              Dokument has 35 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class Dokument extends CActiveRecord implements IRISItem
              {
              
                  public const TYP_STADTRAT_ANTRAG    = "stadtrat_antrag";
                  public const TYP_STADTRAT_VORLAGE   = "stadtrat_vorlage";
              Severity: Minor
              Found in protected/models/Dokument.php - About 4 hrs to fix

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

                                    } else {
                                        if (rel.top < 0) {
                                            animOptions.scrollTop = dim.s.scroll.top + rel.top;
                                        }
                                        else if (rel.top > 0 && rel.bottom < 0) {
                Severity: Major
                Found in html/js/scrollintoview.js and 1 other location - About 4 hrs to fix
                html/js/scrollintoview.js on lines 126..133

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

                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

                                if (options.direction.x === true) {
                                    if (rel.left < 0) {
                                        animOptions.scrollLeft = dim.s.scroll.left + rel.left;
                                    }
                                    else if (rel.left > 0 && rel.right < 0) {
                Severity: Major
                Found in html/js/scrollintoview.js and 1 other location - About 4 hrs to fix
                html/js/scrollintoview.js on lines 115..122

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

                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

                BenutzerIn has 34 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class BenutzerIn extends CActiveRecord
                {
                    // Hinweis: Müssen 2er-Potenzen sein, also 32, 64, 128, ...
                    public const BERECHTIGUNG_USER = 1;
                    public const BERECHTIGUNG_CONTENT = 2;
                Severity: Minor
                Found in protected/models/BenutzerIn.php - About 4 hrs to fix

                  File pdf_embed.php has 340 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  /**
                   * @var string $url
                   */
                  ?>
                  Severity: Minor
                  Found in protected/views/index/pdf_embed.php - About 4 hrs to fix

                    File leaflet.spiderfy.js has 339 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /** @preserve OverlappingMarkerSpiderfier
                     https://github.com/jawj/OverlappingMarkerSpiderfier-Leaflet
                     Copyright (c) 2011 - 2012 George MacKerron
                     Released under the MIT licence: http://opensource.org/licenses/mit-license
                     Note: The Leaflet maps API must be included *before* this code
                    Severity: Minor
                    Found in html/js/leaflet.spiderfy.js - About 4 hrs to fix

                      Method actionIndex has 105 lines of code (exceeds 30 allowed). Consider refactoring.
                      Open

                          public function actionIndex($code = "")
                          {
                              $this->top_menu = "benachrichtigungen";
                      
                              $this->requireLogin($this->createUrl("index/benachrichtigungen"), $code);
                      Severity: Major
                      Found in protected/controllers/BenachrichtigungenController.php - About 4 hrs to fix

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

                            public function parse(int $id): ?Termin
                            {
                                if (SITE_CALL_MODE != "cron") echo "- Termin $id\n";
                        
                                $parsed = $this->downloadCalendarEntryWithDependencies($id);
                        Severity: Major
                        Found in protected/RISParser/TerminParser.php - About 3 hrs to fix

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

                              public static function parseFromHtml(string $html, ?int $idFallback = null): ?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/AntragData.php - About 3 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language