Function frontendListObjectElementShow
has a Cognitive Complexity of 421 (exceeds 5 allowed). Consider refactoring. Open
public function frontendListObjectElementShow
(
$Id = null,
$Filter = null,
// $Data = null,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function frontendListObjectSelect
has a Cognitive Complexity of 313 (exceeds 5 allowed). Consider refactoring. Open
public function frontendListObjectSelect(
$ListId = null,
$ObjectTypeId = null,
$ObjectTypeSelect = null
) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File Frontend.php
has 1623 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace SPHERE\Application\Reporting\CheckList;
use SPHERE\Application\Contact\Address\Address;
Function frontendListObjectAdd
has a Cognitive Complexity of 126 (exceeds 5 allowed). Consider refactoring. Open
public function frontendListObjectAdd($ListId = null, $ObjectId = null, $ObjectTypeId = null, $Option = null)
{
$Stage = new Stage('Check-Listen', 'Ein Object einer Check-Liste hinzufügen');
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method frontendListObjectSelect
has 427 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendListObjectSelect(
$ListId = null,
$ObjectTypeId = null,
$ObjectTypeSelect = null
) {
Method frontendListObjectElementShow
has 403 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendListObjectElementShow
(
$Id = null,
$Filter = null,
// $Data = null,
Method frontendListObjectAdd
has 175 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendListObjectAdd($ListId = null, $ObjectId = null, $ObjectTypeId = null, $Option = null)
{
$Stage = new Stage('Check-Listen', 'Ein Object einer Check-Liste hinzufügen');
Function frontendListObjectElementEdit
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
public function frontendListObjectElementEdit(
$ObjectId = null,
$ListId = null,
$ObjectTypeId = null,
$Data = null,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function formCheckListFilter
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
private function formCheckListFilter(
$filterPersonObjectList
) {
$yearAll = array();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method frontendListObjectElementEdit
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendListObjectElementEdit(
$ObjectId = null,
$ListId = null,
$ObjectTypeId = null,
$Data = null,
Method frontendListElementSelect
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendListElementSelect($Id = null, $Element = null)
{
$Stage = new Stage('Check-Listen', 'Elemente einer Check-Liste zuordnen');
Method frontendDestroyList
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendDestroyList($Id = null, $Confirm = false)
{
$Stage = new Stage('Check-List', 'Löschen');
if ($Id) {
Method formCheckListFilter
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function formCheckListFilter(
$filterPersonObjectList
) {
$yearAll = array();
Method frontendList
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendList($List = null)
{
$Stage = new Stage('Check-Listen', 'Übersicht');
Method frontendListEdit
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendListEdit($Id = null, $List = null)
{
$Stage = new Stage('Check-List', 'Bearbeiten');
$Stage->addButton(
Method frontendListElementEdit
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendListElementEdit($Id = null, $ElementId = null, $ElementName = null)
{
$Stage = new Stage('Name des Elements', 'bearbeiten');
$tblList = ( $Id !== null ? CheckList::useService()->getListById($Id) : false );
Function frontendListElementSelect
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function frontendListElementSelect($Id = null, $Element = null)
{
$Stage = new Stage('Check-Listen', 'Elemente einer Check-Liste zuordnen');
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method frontendListObjectElementEdit
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
$ObjectId = null,
$ListId = null,
$ObjectTypeId = null,
$Data = null,
$YearPersonId = null,
Function frontendDestroyList
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function frontendDestroyList($Id = null, $Confirm = false)
{
$Stage = new Stage('Check-List', 'Löschen');
if ($Id) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid deeply nested control flow statements. Open
if ($tblPerson) {
$tblGroupList = Group::useService()->getGroupAllByPerson($tblPerson);
if ($tblGroupList) {
foreach ($tblGroupList as $tblGroup) {
$tblGroupCommon = Group::useService()->getGroupByMetaTable('COMMON');
Avoid deeply nested control flow statements. Open
if ($tblObjectType->getIdentifier() === 'PERSON') {
foreach ($objects as $objectId => $value) {
$countTotalPerson++;
$tblPerson = Person::useService()->getPersonById($objectId);
if ($tblPerson) {
Avoid deeply nested control flow statements. Open
if ($tblListObjectElementList->getValue() == 1) {
$list[$count]['Field'.$tblListElementList->getId()] = new Center(new SuccessIcon());
}
Avoid deeply nested control flow statements. Open
if ($tblProspectReservation) {
$level = $tblProspectReservation->getReservationDivision();
$year = $tblProspectReservation->getReservationYear();
$optionA = $tblProspectReservation->getServiceTblTypeOptionA();
$optionB = $tblProspectReservation->getServiceTblTypeOptionB();
Avoid deeply nested control flow statements. Open
if (( $tblAddress = Address::useService()->getAddressByPerson($tblPerson) )) {
$Address = $tblAddress->getGuiTwoRowString();
}
Avoid deeply nested control flow statements. Open
if ($tblGroupList) {
foreach ($tblGroupList as $tblGroup) {
$tblGroupCommon = CompanyGroup::useService()->getGroupByMetaTable('COMMON');
if ($tblGroupCommon->getId() != $tblGroup->getId()) {
$groups[] = $tblGroup->getName();
Avoid deeply nested control flow statements. Open
if(($tblToPhoneList = Phone::useService()->getPhoneAllByPerson($tblPerson))) {
$ProspectPhoneList = array();
foreach ($tblToPhoneList as $tblToPhone) {
if (($tblPhone = $tblToPhone->getTblPhone())) {
$ProspectPhoneList[] = $tblPhone->getNumber()
Avoid deeply nested control flow statements. Open
if ($guardianList) {
foreach ($guardianList as $guardian) {
$tblPersonGuardian = $guardian->getServiceTblPersonFrom();
if ($tblPersonGuardian && $guardian->getTblType()->getId() == 1) {
// get PhoneNumber by Guardian
Avoid deeply nested control flow statements. Open
if ($tblListObjectElementList->getValue() === "0") {
$list[$count]['Field'.$tblListElementList->getId()] = ' '.$tblListObjectElementList->getValue();
}
Avoid deeply nested control flow statements. Open
if (!$hasFilter) {
$filterPersonObjectList[$tblPerson->getId()] = $tblPerson;
}
Method frontendListObjectElementShow
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$Id = null,
$Filter = null,
// $Data = null,
// $HasData = null,
$YearPersonId = null,
Avoid too many return
statements within this method. Open
return $Stage.new Success(new SuccessIcon().
' Die '.$tblObjectType->getName().' ist zur Check-Liste hinzugefügt worden.')
.new Redirect('/Reporting/CheckList/Object/Select', Redirect::TIMEOUT_SUCCESS,
array('ListId' => $tblList->getId(), 'ObjectTypeId' => $tblObjectType->getId()));
Avoid too many return
statements within this method. Open
return $Stage;
Avoid too many return
statements within this method. Open
return $Stage . new Danger(new Ban() .
' Die '.$tblObjectType->getName().' konnte zur Check-Liste nicht hinzugefügt werden.')
.new Redirect('/Reporting/CheckList/Object/Select', Redirect::TIMEOUT_ERROR,
array('ListId' => $tblList->getId(), 'ObjectTypeId' => $tblObjectType->getId()));
Avoid too many return
statements within this method. Open
return $Stage . new Danger(new Ban() .
' Die '.$tblObjectType->getName().' konnte zur Check-Liste nicht hinzugefügt werden.')
.new Redirect('/Reporting/CheckList/Object/Select', Redirect::TIMEOUT_ERROR,
array('ListId' => $tblList->getId(), 'ObjectTypeId' => $tblObjectType->getId()));
Avoid too many return
statements within this method. Open
return $Stage.new Success(new SuccessIcon().
' Die '.$tblObjectType->getName().' ist zur Check-Liste hinzugefügt worden.')
.new Success(new SuccessIcon().$countAdd.' Institution/en hinzugefügt.')
.( $countExists > 0 ? new Warning($countExists.' Institution/en existierten bereits in der Check-Liste') : '' )
.new Redirect('/Reporting/CheckList/Object/Select', Redirect::TIMEOUT_SUCCESS,
Avoid too many return
statements within this method. Open
return $Stage.new Success(new SuccessIcon().
' Die '.$tblObjectType->getName().' ist zur Check-Liste hinzugefügt worden.')
.new Success(new SuccessIcon().$countAdd.' Person/en hinzugefügt.')
.( $countExists > 0 ? new Warning($countExists.' Person/en existierten bereits in der Check-Liste') : '' )
.new Redirect('/Reporting/CheckList/Object/Select', Redirect::TIMEOUT_SUCCESS,
Avoid too many return
statements within this method. Open
return $Stage.new Success(new SuccessIcon().
' Die '.$tblObjectType->getName().' ist zur Check-Liste hinzugefügt worden.')
.new Redirect('/Reporting/CheckList/Object/Select', Redirect::TIMEOUT_SUCCESS,
array('ListId' => $tblList->getId(), 'ObjectTypeId' => $tblObjectType->getId()));
Avoid too many return
statements within this method. Open
return $Stage . new Danger(new Ban() .
' Die '.$tblObjectType->getName().' konnte zur Check-Liste nicht hinzugefügt werden.')
.new Redirect('/Reporting/CheckList/Object/Select', Redirect::TIMEOUT_ERROR,
array('ListId' => $tblList->getId(), 'ObjectTypeId' => $tblObjectType->getId()));
Avoid too many return
statements within this method. Open
return $Stage . new Danger(new Ban() .
' Die '.$tblObjectType->getName().' konnte zur Check-Liste nicht hinzugefügt werden.')
.new Redirect('/Reporting/CheckList/Object/Select', Redirect::TIMEOUT_ERROR,
array('ListId' => $tblList->getId(), 'ObjectTypeId' => $tblObjectType->getId()));
Avoid too many return
statements within this method. Open
return $Stage.new Success(new SuccessIcon().
' Die '.$tblObjectType->getName().' ist zur Check-Liste hinzugefügt worden.')
.new Success(new SuccessIcon().$countAdd.' Person/en hinzugefügt.')
.( $countExists > 0 ? new Warning($countExists.' Person/en existierten bereits in der Check-Liste') : '' )
.new Redirect('/Reporting/CheckList/Object/Select', Redirect::TIMEOUT_SUCCESS,
Avoid too many return
statements within this method. Open
return $Stage;
Avoid too many return
statements within this method. Open
return $Stage . new Danger(new Ban() .
' Die '.$tblObjectType->getName().' konnte zur Check-Liste nicht hinzugefügt werden.')
.new Redirect('/Reporting/CheckList/Object/Select', Redirect::TIMEOUT_ERROR,
array('ListId' => $tblList->getId(), 'ObjectTypeId' => $tblObjectType->getId()));
Avoid too many return
statements within this method. Open
return $Stage . new Danger(new Ban() .
' Die '.$tblObjectType->getName().' konnte zur Check-Liste nicht hinzugefügt werden.')
.new Redirect('/Reporting/CheckList/Object/Select', Redirect::TIMEOUT_ERROR,
array('ListId' => $tblList->getId(), 'ObjectTypeId' => $tblObjectType->getId()));
Avoid too many return
statements within this method. Open
return $ObjectA->getId() - $ObjectB->getId();
Avoid too many return
statements within this method. Open
return $Stage.new Success(new SuccessIcon().
' Die '.$tblObjectType->getName().' ist zur Check-Liste hinzugefügt worden.')
.new Redirect('/Reporting/CheckList/Object/Select', Redirect::TIMEOUT_SUCCESS,
array('ListId' => $tblList->getId(), 'ObjectTypeId' => $tblObjectType->getId()));
Avoid too many return
statements within this method. Open
return $Stage . new Danger(new Ban() .
' Die '.$tblObjectType->getName().' konnte zur Check-Liste nicht hinzugefügt werden.')
.new Redirect('/Reporting/CheckList/Object/Select', Redirect::TIMEOUT_ERROR,
array('ListId' => $tblList->getId(), 'ObjectTypeId' => $tblObjectType->getId()));
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function frontendDestroyList($Id = null, $Confirm = false)
{
$Stage = new Stage('Check-List', 'Löschen');
if ($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 587.
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 3 locations. Consider refactoring. Open
} elseif ($tblObjectType->getIdentifier() === 'COMPANYGROUP') {
$tblCompanyGroup = CompanyGroup::useService()->getGroupById($ObjectId);
if ($tblCompanyGroup) {
if (isset($Option[$tblCompanyGroup->getId()])) {
- 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 520.
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 3 locations. Consider refactoring. Open
} elseif ($tblObjectType->getIdentifier() === 'DIVISIONGROUP') {
$tblDivision = Division::useService()->getDivisionById($ObjectId);
if ($tblDivision) {
if (isset($Option[$tblDivision->getId()])) {
- 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 520.
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 3 locations. Consider refactoring. Open
} elseif ($tblObjectType->getIdentifier() === 'PERSONGROUP') {
$tblPersonGroup = PersonGroup::useService()->getGroupById($ObjectId);
if ($tblPersonGroup) {
if (isset($Option[$tblPersonGroup->getId()])) {
- 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 520.
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 ($tblObjectType->getIdentifier() === 'PERSONGROUP') {
$tblPersonGroupAll = PersonGroup::useService()->getGroupAll();
$tblPersonGroupInList = CheckList::useService()->getObjectAllByListAndObjectType($tblList,
$tblObjectType);
- 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 318.
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 ($tblObjectType->getIdentifier() === 'COMPANYGROUP') {
$tblCompanyGroupAll = CompanyGroup::useService()->getGroupAll();
$tblCompanyGroupInList = CheckList::useService()->getObjectAllByListAndObjectType($tblList,
$tblObjectType);
- 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 318.
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 ($tblObjectType->getIdentifier() === 'PERSON') {
$tblPerson = Person::useService()->getPersonById($ObjectId);
if ($tblPerson) {
if (CheckList::useService()->addObjectToList($tblList, $tblObjectType, $tblPerson)) {
return $Stage.new Success(new SuccessIcon().
- 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 184.
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 ($tblObjectType->getIdentifier() === 'COMPANY') {
$tblCompany = Company::useService()->getCompanyById($ObjectId);
if ($tblCompany) {
if (CheckList::useService()->addObjectToList($tblList, $tblObjectType, $tblCompany)) {
return $Stage.new Success(new SuccessIcon().
- 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 184.
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 ($LevelPersonId !== null) {
$Global = $this->getGlobal();
$Global->POST['Filter']['Level'] = $LevelPersonId;
$Global->savePost();
- 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 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
- 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 ($YearPersonId !== null) {
$Global = $this->getGlobal();
$Global->POST['Filter']['Year'] = $YearPersonId;
$Global->savePost();
- 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 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
- 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
Identical blocks of code found in 3 locations. Consider refactoring. Open
if ($tblProspectReservation) {
$level = $tblProspectReservation->getReservationDivision();
$year = $tblProspectReservation->getReservationYear();
$optionA = $tblProspectReservation->getServiceTblTypeOptionA();
$optionB = $tblProspectReservation->getServiceTblTypeOptionB();
- 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 103.
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
'Option' => ( new Form(
new FormGroup(
new FormRow(array(
new FormColumn(
new Primary('Hinzufügen',
- 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 94.
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
'Option' => ( new Form(
new FormGroup(
new FormRow(array(
new FormColumn(
new Primary('Hinzufügen',
- 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 94.
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