Function allocatePersonParentsContact
has a Cognitive Complexity of 143 (exceeds 5 allowed). Consider refactoring. Open
private function allocatePersonParentsContact(&$Data)
{
$Data['Person']['Contact']['All']['Mail'] = '';
$Data['Person']['Contact']['All']['Person']['Mail'] = '';
- 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 allocateStudent
has a Cognitive Complexity of 121 (exceeds 5 allowed). Consider refactoring. Open
private function allocateStudent(&$Data)
{
if ($this->getTblPerson()) {
if (($tblDivisionList = Student::useService()->getCurrentDivisionListByPerson($this->getTblPerson()))) {
- 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 AbstractDocument.php
has 696 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace SPHERE\Application\Api\Document;
use MOC\V\Component\Template\Component\IBridgeInterface;
use SPHERE\Application\Contact\Address\Address;
Function setPhoneNumbersByTypeName
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
private function setPhoneNumbersByTypeName(TblPerson $tblPerson, $TypeName = 'Privat')
{
$IsRemark = false;
if($TypeName == 'Notfall'){
- 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 allocatePersonParentsContact
has 129 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function allocatePersonParentsContact(&$Data)
{
$Data['Person']['Contact']['All']['Mail'] = '';
$Data['Person']['Contact']['All']['Person']['Mail'] = '';
Method allocateStudent
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function allocateStudent(&$Data)
{
if ($this->getTblPerson()) {
if (($tblDivisionList = Student::useService()->getCurrentDivisionListByPerson($this->getTblPerson()))) {
Function allocatePersonParents
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
private function allocatePersonParents(&$Data)
{
if ($this->getTblPerson()) {
if (($tblRelationshipList = Relationship::useService()->getPersonRelationshipAllByPerson($this->getTblPerson()))) {
- 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 allocateResponsibility
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
private function allocateResponsibility(&$Data)
{
$tblPerson = $this->tblPerson;
// pre fill found information (Responsibility)
$Data['Responsibility']['Company']['Number'] = School::useService()->getCompanyNumber();
- 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 getEmergencySlice
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
protected function getEmergencySlice()
{
$slice = new Slice();
- 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
AbstractDocument
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class AbstractDocument
{
/** @var null|Frame $Document */
private $Document = null;
Method getEmergencySlice
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getEmergencySlice()
{
$slice = new Slice();
Method setPhoneNumbersByTypeName
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function setPhoneNumbersByTypeName(TblPerson $tblPerson, $TypeName = 'Privat')
{
$IsRemark = false;
if($TypeName == 'Notfall'){
Function allocatePersonMail
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function allocatePersonMail(&$Data)
{
if ($this->getTblPerson()) {
if (($tblMailList = Mail::useService()->getMailAllByPerson($this->getTblPerson()))) {
- 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 allocatePersonAuthorizedPersons
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function allocatePersonAuthorizedPersons(&$Data)
{
if ($this->getTblPerson()) {
if (($tblRelationshipList = Relationship::useService()->getPersonRelationshipAllByPerson($this->getTblPerson()))) {
- 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 allocatePersonCommon
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function allocatePersonCommon(&$Data)
{
if ($this->getTblPerson()) {
if (($tblCommon = Common::useService()->getCommonByPerson($this->getTblPerson()))
- 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 allocateResponsibility
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function allocateResponsibility(&$Data)
{
$tblPerson = $this->tblPerson;
// pre fill found information (Responsibility)
$Data['Responsibility']['Company']['Number'] = School::useService()->getCompanyNumber();
Function getPhoneNumbers
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function getPhoneNumbers(TblPerson $tblPerson, TblType $tblType, &$phoneNumberList, $IsRemark = false) {
if (($tblPhoneToPersonList = Phone::useService()->getPhoneToPersonAllBy($tblPerson, $tblType))) {
foreach ($tblPhoneToPersonList as $tblPhoneToPerson) {
if (($tblPhone = $tblPhoneToPerson->getTblPhone())) {
if($IsRemark){
- 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 allocatePersonParents
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function allocatePersonParents(&$Data)
{
if ($this->getTblPerson()) {
if (($tblRelationshipList = Relationship::useService()->getPersonRelationshipAllByPerson($this->getTblPerson()))) {
Method setCheckBox
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function setCheckBox(
$content = ' ',
$thicknessInnerLines = '0.5px'
)
{
Avoid deeply nested control flow statements. Open
if ($tblPersonFather && $tblPersonFather->getId() == $tblFromPerson->getId()) {
foreach ($tblPhoneList as $tblToPersonPhone) {
if ($tblToPersonPhone->getTblType()->getName() == 'Privat'
&& $tblToPersonPhone->getTblType()->getDescription() == 'Festnetz'
) {
Avoid deeply nested control flow statements. Open
if ($tblPhoneList) {
$list = array();
foreach ($tblPhoneList as $tblPhoneToPerson) {
$list[] = $tblPhoneToPerson->getTblType()->getName() . ': '
. $tblPhoneToPerson->getTblPhone()->getNumber();
Avoid deeply nested control flow statements. Open
if ($tblPersonMother && $tblPersonMother->getId() == $tblFromPerson->getId()) {
foreach ($tblPhoneList as $tblToPersonPhone) {
if ($tblToPersonPhone->getTblType()->getName() == 'Privat'
&& $tblToPersonPhone->getTblType()->getDescription() == 'Festnetz'
) {
Avoid deeply nested control flow statements. Open
if ($tblAddress) {
$Data['Person']['Parent']['Father']['Address'] = $tblAddress->getGuiString();
}
Avoid deeply nested control flow statements. Open
if ($tblTransfer->getServiceTblType()) {
$Data['Student']['School']['Type'] = $tblTransfer->getServiceTblType()->getName();
}
Avoid deeply nested control flow statements. Open
if ($tblCompany && $tblSchoolType) {
$tblSchool = School::useService()->getSchoolByCompanyAndType($tblCompany, $tblSchoolType);
if ($tblSchool) {
// fill found information (School)
$Data['Responsibility']['Company']['Number'] = School::useService()->getCompanyNumber($tblSchool);
Avoid deeply nested control flow statements. Open
if ($tblAddress) {
$Data['Person']['Parent']['Mother']['Address'] = $tblAddress->getGuiString();
}
Avoid deeply nested control flow statements. Open
if (($tblStudentSchoolEnrollmentType = $tblTransfer->getTblStudentSchoolEnrollmentType())) {
if ($tblStudentSchoolEnrollmentType->getIdentifier() == 'POSTPONED') {
$Data['Student']['School']['Enrollment']['Postponed'] = 'X';
}
if ($tblStudentSchoolEnrollmentType->getIdentifier() == 'PREMATURE') {
Avoid deeply nested control flow statements. Open
if (($tblCompany = $tblTransfer->getServiceTblCompany())) {
if (($tblAddress = $tblCompany->fetchMainAddress())) {
$Data['Document']['PlaceDate'] = $tblAddress->getTblCity()->getName() . ', '
. date('d.m.Y');
$Data['Document']['Date']['Now'] = date('d.m.Y');
Avoid deeply nested control flow statements. Open
if (($tblMail = $tblToPersonMail->getTblMail())) {
$Data['Person']['Contact']['All']['Person']['Mail'] .= $tblFromPerson->getLastFirstName().': '
.$tblMail->getAddress().';<br/>';
// set next row if line ist to long
$ControlString = $Data['Person']['Contact']['All']['Mail'].
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ($tblPersonFather && $tblPersonFather->getId() == $tblFromPerson->getId()) {
foreach ($tblPhoneList as $tblToPersonPhone) {
if ($tblToPersonPhone->getTblType()->getName() == 'Privat'
&& $tblToPersonPhone->getTblType()->getDescription() == 'Festnetz'
) {
- 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 325.
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 ($tblPersonMother && $tblPersonMother->getId() == $tblFromPerson->getId()) {
foreach ($tblPhoneList as $tblToPersonPhone) {
if ($tblToPersonPhone->getTblType()->getName() == 'Privat'
&& $tblToPersonPhone->getTblType()->getDescription() == 'Festnetz'
) {
- 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 325.
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
protected function setCheckBox(
$content = ' ',
$thicknessInnerLines = '0.5px'
)
{
- 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 176.
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 (!isset($Data['Person']['Parent']['Mother']['Name'])) {
$Data['Person']['Parent']['Mother']['Name']['First'] = $tblFromPerson->getFirstSecondName();
$Data['Person']['Parent']['Mother']['Name']['Last'] = $tblFromPerson->getLastName();
$Data['Person']['Parent']['Mother']['Name']['LastFirst'] = $tblFromPerson->getLastFirstName();
$tblAddress = Address::useService()->getAddressByPerson($tblFromPerson);
- 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 139.
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 (!isset($Data['Person']['Parent']['Father']['Name'])) {
$Data['Person']['Parent']['Father']['Name']['First'] = $tblFromPerson->getFirstSecondName();
$Data['Person']['Parent']['Father']['Name']['Last'] = $tblFromPerson->getLastName();
$Data['Person']['Parent']['Father']['Name']['LastFirst'] = $tblFromPerson->getLastFirstName();
$tblAddress = Address::useService()->getAddressByPerson($tblFromPerson);
- 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 139.
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