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

        foreach ($gestellt_von as $x) if (!in_array($x["name_normalized"], $indexed)) {
            $indexed[]     = $x["name_normalized"];
            $person        = Person::getOrCreate($x["name"], $x["name_normalized"]);
            $ap            = new AntragPerson();
            $ap->antrag_id = $this->id;
Severity: Major
Found in protected/models/Antrag.php and 1 other location - About 3 hrs to fix
protected/models/Antrag.php on lines 347..358

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

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

        foreach ($initiatorInnen as $x) if (!in_array($x["name_normalized"], $indexed)) {
            $indexed[]     = $x["name_normalized"];
            $person        = Person::getOrCreate($x["name"], $x["name_normalized"]);
            $ap            = new AntragPerson();
            $ap->antrag_id = $this->id;
Severity: Major
Found in protected/models/Antrag.php and 1 other location - About 3 hrs to fix
protected/models/Antrag.php on lines 333..344

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

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 ($dokument->antrag_id > 0) {
                        if (!isset($ergebnisse["antraege"][$dokument->antrag_id])) {
                            $ergebnisse["antraege"][$dokument->antrag_id] = [
                                "antrag" => $dokument->antrag,
                                "dokumente" => []
Severity: Major
Found in protected/models/BenutzerIn.php and 1 other location - About 3 hrs to fix
protected/models/BenutzerIn.php on lines 401..415

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

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

                    } elseif ($dokument->termin_id > 0) {
                        if (!isset($ergebnisse["termine"][$dokument->termin_id])) {
                            $ergebnisse["termine"][$dokument->termin_id] = [
                                "termin" => $dokument->termin,
                                "dokumente" => []
Severity: Major
Found in protected/models/BenutzerIn.php and 1 other location - About 3 hrs to fix
protected/models/BenutzerIn.php on lines 387..415

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

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

Function Cache has 97 lines of code (exceeds 30 allowed). Consider refactoring.
Open

$.Autocompleter.Cache = function(options) {

    var data = {};
    var length = 0;
    
Severity: Major
Found in docs/solr-core/conf/velocity/jquery.autocomplete.js - About 3 hrs to fix

    Method getBeschreibungDerSuche has 97 lines of code (exceeds 30 allowed). Consider refactoring.
    Open

        public function getBeschreibungDerSuche($dokument = null)
        {
            if (count($this->krits) == 1) switch ($this->krits[0]["typ"]) {
                case "betreff":
                    $such = $this->krits[0]["suchbegriff"];
    Severity: Major
    Found in protected/components/RISSucheKrits.php - About 3 hrs to fix

      File anzeige.php has 318 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * @var Antrag $antrag
       * @var AntraegeController $this
       * @var bool $tag_mode
      Severity: Minor
      Found in protected/views/antraege/anzeige.php - About 3 hrs to fix

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

            public function parse(int $id): StadtraetIn
            {
                if (SITE_CALL_MODE != "cron") echo "- StadträtIn $id\n";
        
                $htmlFraktionen = $this->curlBasedDownloader->loadUrl(RIS_URL_PREFIX . 'person/detail/' . $id . '?tab=fraktionen');
        Severity: Major
        Found in protected/RISParser/StadtraetInnenParser.php - About 3 hrs to fix

          Method run has 93 lines of code (exceeds 30 allowed). Consider refactoring.
          Open

              public function run($args)
              {
          
                  $sitemap_files = [];
          
          
          Severity: Major
          Found in protected/commands/GoogleSitemapCreateCommand.php - About 3 hrs to fix

            Antrag has 29 functions (exceeds 20 allowed). Consider refactoring.
            Open

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

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

                  public function rules()
                  {
                      // NOTE: you should only define rules for those attributes that
                      // will receive user inputs.
                      return [
              Severity: Major
              Found in protected/models/AntragHistory.php and 1 other location - About 3 hrs to fix
              protected/models/Antrag.php on lines 82..98

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

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

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

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

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

              Refactorings

              Further Reading

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

                  public function rules()
                  {
                      // NOTE: you should only define rules for those attributes that
                      // will receive user inputs.
                      return [
              Severity: Major
              Found in protected/models/Antrag.php and 1 other location - About 3 hrs to fix
              protected/models/AntragHistory.php on lines 57..73

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

              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

                          for ($i = 0; $i < 100 && $goon; $i++) {
                              $page = intval($this->getInnerHtml('.colors_suche .btn-pagelink[disabled] span'));
              
                              if ($page !== $i + 1) {
                                  throw new ParsingException('Switched to page ' . ($i + 1) . ', but HTML indicates ' . $page);
              Severity: Major
              Found in protected/components/BrowserBasedDowloader.php and 1 other location - About 3 hrs to fix
              protected/components/BrowserBasedDowloader.php on lines 142..157

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

              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

                          for ($i = 0; $i < 100 && $goon; $i++) {
                              $page = intval($this->getInnerHtml('.colors_person .btn-pagelink[disabled] span'));
              
                              if ($page !== $i + 1) {
                                  throw new ParsingException('Switched to page ' . ($i + 1) . ', but HTML indicates ' . $page);
              Severity: Major
              Found in protected/components/BrowserBasedDowloader.php and 1 other location - About 3 hrs to fix
              protected/components/BrowserBasedDowloader.php on lines 109..124

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

              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

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

              class AdminController extends RISBaseController
              {
                  public function actionStadtraetInnenPersonen()
                  {
                      if (!$this->binContentAdmin()) $this->errorMessageAndDie(403, "");

              The class Dokument has 16 public methods. Consider refactoring Dokument to keep number of public methods under 10.
              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 by phpmd

              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

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

              class StadtratsvorlageParser extends RISParser
              {
                  private BrowserBasedDowloader $browserBasedDowloader;
                  private CurlBasedDownloader $curlBasedDownloader;
                  private StadtratsantragParser $stadtratsantragParser;

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

              class OParl10Object {
                  const TYPE_AGENDAITEM      = 'https://schema.oparl.org/1.0/AgendaItem';
                  const TYPE_BODY            = 'https://schema.oparl.org/1.0/Body';
                  const TYPE_CONSULTATION    = 'https://schema.oparl.org/1.0/Consultation';
                  const TYPE_FILE            = 'https://schema.oparl.org/1.0/File';

              The class InfosController has 12 public methods. Consider refactoring InfosController to keep number of public methods under 10.
              Open

              class InfosController extends RISBaseController
              {
                  public function actionSoFunktioniertStadtpolitik()
                  {
                      $this->top_menu = "so_funktioniert";

              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

              The class BenutzerIn has an overall complexity of 88 which is very high. The configured complexity threshold is 50.
              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 by phpmd
              Severity
              Category
              Status
              Source
              Language