Function getStudentTableContent
has a Cognitive Complexity of 482 (exceeds 5 allowed). Consider refactoring. Open
public function getStudentTableContent($Result, $Option = null, $PersonGroup = null)
{
$SearchResult = array();
if (!empty($Result)) {
- 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 Service.php
has 2714 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace SPHERE\Application\Reporting\Standard\Person;
use MOC\V\Component\Document\Component\Bridge\Repository\PhpExcel;
Method getStudentTableContent
has 366 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getStudentTableContent($Result, $Option = null, $PersonGroup = null)
{
$SearchResult = array();
if (!empty($Result)) {
Method createGroupList
has 249 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createGroupList(TblGroup $tblGroup)
{
$tblPersonList = Group::useService()->getPersonAllByGroup($tblGroup);
$TableContent = array();
Function createGroupListExcel
has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring. Open
public function createGroupListExcel($PersonList, $tblPersonList, $GroupId)
{
$tblGroup = Group::useService()->getGroupById($GroupId);
if (!empty($PersonList) && $tblGroup) {
- 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 createClassList
has 219 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createClassList(TblDivision $tblDivision)
{
$tblPersonList = Division::useService()->getStudentAllByDivision($tblDivision);
Method createInterestedPersonList
has 208 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createInterestedPersonList()
{
$tblPersonList = Group::useService()->getPersonAllByGroup(Group::useService()->getGroupByMetaTable('PROSPECT'));
$TableContent = array();
Function createMedicalInsuranceClassListExcel
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
public function createMedicalInsuranceClassListExcel($PersonList, $tblPersonList)
{
if (!empty($PersonList)) {
- 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 createGroupListExcel
has 148 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createGroupListExcel($PersonList, $tblPersonList, $GroupId)
{
$tblGroup = Group::useService()->getGroupById($GroupId);
if (!empty($PersonList) && $tblGroup) {
Method createElectiveClassList
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createElectiveClassList(TblDivision $tblDivision)
{
$tblPersonList = Division::useService()->getStudentAllByDivision($tblDivision);
$TableContent = array();
Method createMedicalInsuranceClassList
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createMedicalInsuranceClassList(TblDivision $tblDivision)
{
$tblPersonList = Division::useService()->getStudentAllByDivision($tblDivision);
$TableContent = array();
Function createElectiveClassListExcel
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
public function createElectiveClassListExcel($PersonList, $tblPersonList, $DivisionId)
{
// get PersonList sorted by GradeBook
if (!empty($PersonList)) {
- 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 createMetaDataComparisonExcel
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createMetaDataComparisonExcel($Person = null, $Year = null, $Division = null, $Option = null, $PersonGroup = null)
{
$Result = $this->getStudentFilterResult($Person, $Year, $Division, $PersonGroup);
Method createAgreementClassList
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createAgreementClassList(TblDivision $tblDivision)
{
$tblPersonList = Division::useService()->getStudentAllByDivision($tblDivision);
$TableContent = array();
Method createClassListExcel
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createClassListExcel($PersonList, $tblPersonList)
{
if (!empty($PersonList)) {
Method createExtendedClassList
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createExtendedClassList(TblDivision $tblDivision)
{
$tblPersonList = Division::useService()->getStudentAllByDivision($tblDivision);
$TableContent = array();
Method createInterestedPersonListExcel
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createInterestedPersonListExcel($PersonList, $tblPersonList)
{
if (!empty($PersonList)) {
Method createExtendedClassListExcel
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createExtendedClassListExcel($PersonList, $tblPersonList)
{
if (!empty($PersonList)) {
Method createElectiveClassListExcel
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createElectiveClassListExcel($PersonList, $tblPersonList, $DivisionId)
{
// get PersonList sorted by GradeBook
if (!empty($PersonList)) {
Function createClassListExcel
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function createClassListExcel($PersonList, $tblPersonList)
{
if (!empty($PersonList)) {
- 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 createMedicalInsuranceClassListExcel
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createMedicalInsuranceClassListExcel($PersonList, $tblPersonList)
{
if (!empty($PersonList)) {
Function getPhoneList
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
private function getPhoneList(TblPerson $tblPerson, $IsExcel = false)
{
$tblToPersonList = Phone::useService()->getPhoneAllByPerson($tblPerson);
- 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 getStudentFilterResult
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getStudentFilterResult($Person, $Year, $Division, $PersonGroup)
{
$Pile = new Pile(Pile::JOIN_TYPE_INNER);
$Pile->addPile((new ViewPerson())->getViewService(), new ViewPerson(),
Service
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class Service extends Extension
{
/**
* @param IFormInterface|null $Stage
Method createBirthdayClassList
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createBirthdayClassList(TblDivision $tblDivision)
{
$tblPersonList = Division::useService()->getStudentAllByDivision($tblDivision);
Method createAgreementClassListExcel
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createAgreementClassListExcel($PersonList, $tblPersonList)
{
if (!empty($PersonList)) {
Method createAbsenceListExcel
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createAbsenceListExcel(\DateTime $dateTime, $Type = null, $DivisionName = '')
{
if ($Type != null) {
$tblType = Type::useService()->getTypeById($Type);
Function createExtendedClassListExcel
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function createExtendedClassListExcel($PersonList, $tblPersonList)
{
if (!empty($PersonList)) {
- 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 createMedicalRecordClassList
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createMedicalRecordClassList(TblDivision $tblDivision)
{
$tblPersonList = Division::useService()->getStudentAllByDivision($tblDivision);
$TableContent = array();
Method getPhoneList
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getPhoneList(TblPerson $tblPerson, $IsExcel = false)
{
$tblToPersonList = Phone::useService()->getPhoneAllByPerson($tblPerson);
Method createMedicalRecordClassListExcel
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createMedicalRecordClassListExcel($PersonList, $tblPersonList)
{
if (!empty($PersonList)) {
Method createBirthdayClassListExcel
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createBirthdayClassListExcel($PersonList, $tblPersonList)
{
if (!empty($PersonList)) {
Function getStudentFilterResult
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getStudentFilterResult($Person, $Year, $Division, $PersonGroup)
{
$Pile = new Pile(Pile::JOIN_TYPE_INNER);
$Pile->addPile((new ViewPerson())->getViewService(), new ViewPerson(),
- 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 createAbsenceListExcel
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function createAbsenceListExcel(\DateTime $dateTime, $Type = null, $DivisionName = '')
{
if ($Type != null) {
$tblType = Type::useService()->getTypeById($Type);
- 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 createMetaDataComparisonExcel
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function createMetaDataComparisonExcel($Person = null, $Year = null, $Division = null, $Option = null, $PersonGroup = null)
{
$Result = $this->getStudentFilterResult($Person, $Year, $Division, $PersonGroup);
- 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 (isset($tblPhoneList[$key])) {
$tblPhoneList[$key] .= ')';
}
Avoid deeply nested control flow statements. Open
if (($tblCommonGender = $tblCommonBirthDates->getTblCommonGender())) {
$DataPerson['Gender'] = $tblCommonGender->getName();
}
Avoid deeply nested control flow statements. Open
if ($PhoneDescription == 'Festnetz') {
switch ($PhoneName) {
case 'Privat':
if (empty($DataPerson['PhoneFixedPrivate'])) {
$DataPerson['PhoneFixedPrivate'] = $tblPhone->getNumber()
Avoid deeply nested control flow statements. Open
if ($tblType->getName() == 'Geschwisterkind') {
if (($tblPersonFrom = $tblToPerson->getServiceTblPersonFrom()) && ($tblPersonTo = $tblToPerson->getServiceTblPersonTo())) {
if ($tblPersonFrom->getId() !== $tblPerson->getId()) {
$tblPersonSibling = $tblPersonFrom;
} elseif ($tblPersonTo->getId() !== $tblPerson->getId()) {
Avoid deeply nested control flow statements. Open
switch ($tblAgreementType->getName()) {
case 'in Schulschriften':
($CategoryString == 'Foto des SchĂĽlers'
? $Item['PictureSchoolWriting'] = $MarkValue
: $Item['NameSchoolWriting'] = $MarkValue);
Avoid deeply nested control flow statements. Open
if (is_numeric($Year) && is_numeric($Month) && is_numeric($Day)) {
$Item['BirthdayYearSort'] = ($Year * 10000) + ($Month * 100) + $Day;
}
Avoid deeply nested control flow statements. Open
if (($tblLevelTill = $tblStudentSubject->getServiceTblLevelTill()) &&
($LevelTill = Division::useService()->getLevelById($tblLevelTill->getId())->getName())
&& (is_numeric($LevelTill)) && (is_numeric($tblDivisionLevel->getName()))) {
if ($tblDivisionLevel->getName() > $LevelTill) {
$Item['ForeignLanguage' . $i] = '';
Avoid deeply nested control flow statements. Open
switch($tblStudentAgreement->getTblStudentAgreementType()->getName()){
case 'in Schulschriften':
$Item['Picture1'] = 'Ja';
break;
case 'in Veröffentlichungen':
Avoid deeply nested control flow statements. Open
switch($tblStudentAgreement->getTblStudentAgreementType()->getName()){
case 'in Schulschriften':
$Item['Name1'] = 'Ja';
break;
case 'in Veröffentlichungen':
Avoid deeply nested control flow statements. Open
if ($tblMail) {
if (isset($tblMailList[$key])) {
$tblMailList[$key] = $tblMailList[$key] . ', '
. $tblMail->getAddress();
} else {
Avoid deeply nested control flow statements. Open
if (($tblLevelFrom = $tblStudentSubject->getServiceTblLevelFrom())
&& ($LevelFrom = Division::useService()->getLevelById($tblLevelFrom->getId())->getName())
&& (is_numeric($LevelFrom)) && (is_numeric($tblDivisionLevel->getName()))) {
if ($tblDivisionLevel->getName() < $LevelFrom) {
$Item['ForeignLanguage' . $i] = '';
Avoid deeply nested control flow statements. Open
if ($tblCourse) {
if ($tblCourse->getName() == 'Gymnasium') {
$Item['Education'] = 'GY';
} elseif ($tblCourse->getName() == 'Hauptschule') {
$Item['Education'] = 'HS';
Avoid deeply nested control flow statements. Open
if($tblRelationshipCustody
&& ($tblPersonCustody = $tblRelationshipCustody->getServiceTblPersonFrom())){
$DataPerson['Custody_'.$i.'_Salutation'] = $tblPersonCustody->getSalutation();
$DataPerson['Custody_'.$i.'_Title'] = $tblPersonCustody->getTitle();
$DataPerson['Custody_'.$i.'_FirstName'] = $tblPersonCustody->getFirstName();
Avoid deeply nested control flow statements. Open
if ($tblPhone) {
if (!$FirstNumber) {
$tblPhoneList[$key] .= ', '
. $tblPhone->getNumber() . ' ' . $this->getShortTypeByTblToPersonPhone($tblToPersonPhone);
} else {
Avoid deeply nested control flow statements. Open
if (isset($tblMailList[$key])) {
$tblMailList[$key] .= ')';
}
Avoid deeply nested control flow statements. Open
if (is_numeric($Month) && is_numeric($Day)) {
$Item['BirthdaySort'] = $Month * 100 + $Day;
}
Avoid deeply nested control flow statements. Open
if ($tblMail) {
$MailListSimple[$tblMail->getId()] = $tblMail->getAddress();
if (isset($tblMailList[$tblPersonGuardian->getId()])) {
$tblMailList[$tblPersonGuardian->getId()] = $tblMailList[$tblPersonGuardian->getId()].', '
.$tblMail->getAddress();
Avoid deeply nested control flow statements. Open
if (isset($tblMailList[$tblPersonGuardian->getId()])) {
$tblMailList[$tblPersonGuardian->getId()] .= ')';
}
Avoid deeply nested control flow statements. Open
if ($tblToPhoneList) {
foreach ($tblToPhoneList as $tblToPhone) {
if (($tblPhone = $tblToPhone->getTblPhone())) {
$PhoneGuardianListSimple[$tblPhone->getId()] = $tblPhone->getNumber();
if (!isset($Item['PhoneGuardian'][$tblPersonGuardian->getId()])) {
Avoid deeply nested control flow statements. Open
if (!empty($tblCommonBirthDates->getBirthday())) {
$DataPerson['Birthday'] = $tblCommonBirthDates->getBirthday();
}
Avoid deeply nested control flow statements. Open
if (!empty($tblCommonBirthDates->getBirthplace())) {
$DataPerson['BirthPlace'] = $tblCommonBirthDates->getBirthplace();
}
Avoid deeply nested control flow statements. Open
if($tblRelationshipCustodyControl->getRanking() == $i || $i == 1
&& $tblRelationshipCustodyControl->getRanking() === null){
$tblRelationshipCustody = $tblRelationshipCustodyControl;
break;
}
Avoid deeply nested control flow statements. Open
if ($tblDivision->getTblLevel() && $tblDivision->getTblLevel()->getName() != '') {
$Item['SchoolType'] = $tblDivision->getTypeName();
}
Avoid deeply nested control flow statements. Open
if (isset($Item['PhoneGuardian'][$tblPersonGuardian->getId()])) {
$Item['PhoneGuardian'][$tblPersonGuardian->getId()] .= ')';
}
Method createMetaDataComparisonExcel
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function createMetaDataComparisonExcel($Person = null, $Year = null, $Division = null, $Option = null, $PersonGroup = null)
Function getShortTypeByTblToPersonPhone
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getShortTypeByTblToPersonPhone(TblToPersonPhone $tblToPerson)
{
$result = '';
$tblType = $tblToPerson->getTblType();
- 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
} elseif ($PhoneDescription == 'Mobil') {
switch ($PhoneName) {
case 'Privat':
if (empty($DataPerson['PhoneMobilePrivate'])) {
$DataPerson['PhoneMobilePrivate'] = $tblPhone->getNumber()
- 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 326.
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 ($PhoneDescription == 'Festnetz') {
switch ($PhoneName) {
case 'Privat':
if (empty($DataPerson['PhoneFixedPrivate'])) {
$DataPerson['PhoneFixedPrivate'] = $tblPhone->getNumber()
- 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 326.
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 2 locations. Consider refactoring. Open
if (($tblDivision = Division::useService()->getDivisionById($DivisionId))) {
$tblDivisionCustodyList = Division::useService()->getCustodyAllByDivision($tblDivision);
if ($tblDivisionCustodyList) {
foreach ($tblDivisionCustodyList as $tblPerson) {
$custodyList[] = trim($tblPerson->getSalutation() . ' ' . $tblPerson->getLastName());
- 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 230.
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 2 locations. Consider refactoring. Open
if ($tblStudentElectiveList) {
foreach ($tblStudentElectiveList as $tblStudentElective) {
if ($tblStudentElective->getServiceTblSubject()) {
$tblSubjectRanking = $tblStudentElective->getTblStudentSubjectRanking();
if ($tblSubjectRanking) {
- 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 143.
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 2 locations. Consider refactoring. Open
if ($Item['Phone'] == '') {
$Item['Phone'] = $tblPerson->getFirstName() . ' ' . $tblPerson->getLastName() . ' (' . $tblPhone->getNumber() . ' ' .
// modify TypeShort
str_replace('.', '', Phone::useService()->getPhoneTypeShort($tblToPhone));
} else {
- 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 132.
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 2 locations. Consider refactoring. Open
if ($tblTransferType) {
$tblStudentTransfer = Student::useService()->getStudentTransferByType($tblStudent,
$tblTransferType);
if ($tblStudentTransfer) {
$tblCourse = $tblStudentTransfer->getServiceTblCourse();
- 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 129.
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
} else {
switch($tblStudentAgreement->getTblStudentAgreementType()->getName()){
case 'in Schulschriften':
$Item['Name1'] = 'Ja';
break;
- 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 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
- 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($tblStudentAgreementCategory->getName() == 'Foto des SchĂĽlers') {
switch($tblStudentAgreement->getTblStudentAgreementType()->getName()){
case 'in Schulschriften':
$Item['Picture1'] = 'Ja';
break;
- 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 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
- 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 2 locations. Consider refactoring. Open
if ($tblGroup->getMetaTable() == 'STUDENT') {
$ColumnCustom = array(
'Identifier' => 'SchĂĽlernummer',
'School' => 'Schule',
'SchoolType' => 'Schulart',
- 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 115.
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 6 locations. Consider refactoring. Open
if (isset($Division) && $Division) {
array_walk($Division, function (&$Input) {
if (!empty($Input)) {
$Input = explode(' ', $Input);
- 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 110.
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 6 locations. Consider refactoring. Open
if (isset($PersonGroup) && $PersonGroup) {
array_walk($PersonGroup, function (&$Input) {
if (!empty($Input)) {
$Input = explode(' ', $Input);
- 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 110.
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 6 locations. Consider refactoring. Open
if (isset($Person) && $Person) {
array_walk($Person, function (&$Input) {
if (!empty($Input)) {
$Input = explode(' ', $Input);
- 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 110.
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 12 locations. Consider refactoring. Open
if ($tblToPersonAddress && ($tblAddress = $tblToPersonAddress->getTblAddress())) {
$Item['StreetName'] = $tblAddress->getStreetName();
$Item['StreetNumber'] = $tblAddress->getStreetNumber();
$Item['Code'] = $tblAddress->getTblCity()->getCode();
$Item['City'] = $tblAddress->getTblCity()->getName();
- 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 109.
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 12 locations. Consider refactoring. Open
if ($tblToPersonAddress && ($tblAddress = $tblToPersonAddress->getTblAddress())) {
$Item['StreetName'] = $tblAddress->getStreetName();
$Item['StreetNumber'] = $tblAddress->getStreetNumber();
$Item['Code'] = $tblAddress->getTblCity()->getCode();
$Item['City'] = $tblAddress->getTblCity()->getName();
- 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 109.
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 12 locations. Consider refactoring. Open
if ($tblToPersonAddress && ($tblAddress = $tblToPersonAddress->getTblAddress())) {
$Item['StreetName'] = $tblAddress->getStreetName();
$Item['StreetNumber'] = $tblAddress->getStreetNumber();
$Item['Code'] = $tblAddress->getTblCity()->getCode();
$Item['City'] = $tblAddress->getTblCity()->getName();
- 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 109.
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 12 locations. Consider refactoring. Open
if ($tblToPersonAddress && ($tblAddress = $tblToPersonAddress->getTblAddress())) {
$Item['StreetName'] = $tblAddress->getStreetName();
$Item['StreetNumber'] = $tblAddress->getStreetNumber();
$Item['Code'] = $tblAddress->getTblCity()->getCode();
$Item['City'] = $tblAddress->getTblCity()->getName();
- 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 109.
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 12 locations. Consider refactoring. Open
if ($tblToPersonAddress && ($tblAddress = $tblToPersonAddress->getTblAddress())) {
$Item['StreetName'] = $tblAddress->getStreetName();
$Item['StreetNumber'] = $tblAddress->getStreetNumber();
$Item['Code'] = $tblAddress->getTblCity()->getCode();
$Item['City'] = $tblAddress->getTblCity()->getName();
- 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 109.
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 2 locations. Consider refactoring. Open
if ($tblAddress) {
$Item['StreetName'] = $tblAddress->getStreetName();
$Item['StreetNumber'] = $tblAddress->getStreetNumber();
$Item['Code'] = $tblAddress->getTblCity()->getCode();
$Item['City'] = $tblAddress->getTblCity()->getName();
- 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 98.
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 2 locations. Consider refactoring. Open
if ($tblAddress) {
$Item['StreetName'] = $tblAddress->getStreetName();
$Item['StreetNumber'] = $tblAddress->getStreetNumber();
$Item['Code'] = $tblAddress->getTblCity()->getCode();
$Item['City'] = $tblAddress->getTblCity()->getName();
- 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 98.
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 (($salutation = $guardian->getServiceTblPersonFrom()->getTblSalutation())) {
if ($salutation->getId() == 1) {
$father = $guardian->getServiceTblPersonFrom();
} elseif ($salutation->getId() == 2) {
$mother = $guardian->getServiceTblPersonFrom();
- 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 96.
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 4 locations. Consider refactoring. Open
case 'Notfall':
if(!empty($DataPerson['Custody_'.$i.'_PhoneFixedEmergency'])){
$DataPerson['Custody_'.$i.'_PhoneFixedEmergency'] .= ', ';
}
$DataPerson['Custody_'.$i.'_PhoneFixedEmergency'] .= $tblPhoneCustody->getNumber()
- 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 95.
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 4 locations. Consider refactoring. Open
case 'Privat':
if(!empty($DataPerson['Custody_'.$i.'_PhoneMobilePrivate'])){
$DataPerson['Custody_'.$i.'_PhoneMobilePrivate'] .= ', ';
}
$DataPerson['Custody_'.$i.'_PhoneMobilePrivate'] .= $tblPhoneCustody->getNumber()
- 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 95.
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 4 locations. Consider refactoring. Open
case 'Geschäftlich':
if(!empty($DataPerson['Custody_'.$i.'_PhoneMobileWork'])){
$DataPerson['Custody_'.$i.'_PhoneMobileWork'] .= ', ';
}
$DataPerson['Custody_'.$i.'_PhoneMobileWork'] .= $tblPhoneCustody->getNumber()
- 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 95.
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 4 locations. Consider refactoring. Open
case 'Geschäftlich':
if(!empty($DataPerson['Custody_'.$i.'_PhoneFixedWork'])){
$DataPerson['Custody_'.$i.'_PhoneFixedWork'] .= ', ';
}
$DataPerson['Custody_'.$i.'_PhoneFixedWork'] .= $tblPhoneCustody->getNumber()
- 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 95.
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 2 locations. Consider refactoring. Open
if ($tblProspectReservation) {
$Item['SchoolYear'] = $tblProspectReservation->getReservationYear();
if ($tblProspectReservation->getServiceTblTypeOptionA()) {
$Item['TypeOptionA'] = $tblProspectReservation->getServiceTblTypeOptionA()->getName();
}
- 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 91.
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