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;
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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;
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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" => []
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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" => []
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function Cache
has 97 lines of code (exceeds 30 allowed). Consider refactoring. Open
$.Autocompleter.Cache = function(options) {
var data = {};
var length = 0;
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"];
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
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');
Method run
has 93 lines of code (exceeds 30 allowed). Consider refactoring. Open
public function run($args)
{
$sitemap_files = [];
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";
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 [
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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 [
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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);
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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);
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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, "");
- Exclude checks
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";
- Read upRead up
- Exclude checks
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;
- Exclude checks
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';
- Exclude checks
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";
- Read upRead up
- Exclude checks
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;
- Exclude checks