Showing 5,014 of 7,620 total issues
Avoid deeply nested control flow statements. Open
Open
if ($Key > 2) {
break;
}
Avoid deeply nested control flow statements. Open
Open
if (( $tblAddress = $serviceTblPersonToAddress->getTblAddress() )) {
if (!isset($Data[$tblAddress->getId()]['Person'])) {
$Data[$tblAddress->getId()]['Person'] =
$PersonToAddress->getLastName().' '.$PersonToAddress->getFirstName();
if ($PersonToAddress->getSalutation() === '') {
Avoid deeply nested control flow statements. Open
Open
if ($tblToCompany->getServiceTblCompany()->getId() === $tblRelationship->getServiceTblCompany()->getId()) {
$RelationShip = $tblType->getName();
/** @var TblToPerson $tblRelationship */
$subDataList[] = array(
'Salutation' => $tblPerson->getSalutation(),
Avoid deeply nested control flow statements. Open
Open
if (( $tblAddress = $serviceTblPersonToAddress->getTblAddress() )) {
if (!isset($AddressList[$tblPerson->getId().$tblAddress->getId()]['PersonToWrite'])) {
$AddressList[$tblPerson->getId().$tblAddress->getId()]['PersonToWrite'] =
$PersonToAddress->getLastName().' '.$PersonToAddress->getFirstName();
$AddressList[$tblPerson->getId().$tblAddress->getId()]['SalutationList'] =
Avoid deeply nested control flow statements. Open
Open
if ($tblToPersonList) {
$tblType = Address::useService()->getTypeById(1);
$tblToPersonChoose = null;
// Ziehen der ersten Hauptadresse
/** @var TblToPerson $tblToPerson */
Avoid deeply nested control flow statements. Open
Open
if (!empty($FilterProspect)) {
foreach ($FilterProspect as $FieldName => $FilterNumberList) {
foreach ($FilterNumberList as $FilterNumber => $FieldValue) {
if ($FieldValue) {
( new Data($this->getBinding()) )->createFilterField($tblSerialLetter, $tblFilterCategory,
Avoid deeply nested control flow statements. Open
Open
if ($tblToCompanyList) {
foreach ($tblToCompanyList as $tblToCompany) {
if ($tblToCompany->getTblType()->getId() === $tblType->getId()) {
// $tblSalutation = $tblPerson->getTblSalutation();
$PersonTo = $tblPerson;
Function frontendPersonAddressContent
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
private function frontendPersonAddressContent($Id = null)
{
$Stage = new Stage('Adresslisten für Serienbriefe', 'Person mit Adressen auswählen');
$Stage->addButton(new Standard('Zurück', '/Reporting/SerialLetter', new ChevronLeft()));
- 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
Open
if (( $PersonToAddress = $tblToPerson->getServiceTblPerson() )) {
if (( $tblAddress = $serviceTblPersonToAddress->getTblAddress() )) {
//Person SerialLetter
$AddressList[$tblPerson->getId().$tblAddress->getId()]['Salutation'] =
$tblPerson->getSalutation();
Avoid deeply nested control flow statements. Open
Open
if ($tblLevel && $tblYear) {
$VisitedDivisionList[] = new Small(new Muted('Aktuelle Klasse:')).new Container($tblDivision->getDisplayName());
}
Method getFormField
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function getFormField( $PropertyName, $Placeholder = null, $Label = null, IIconInterface $Icon = null,
$doResetCount = false, $ViewType = TblWorkSpace::VIEW_TYPE_ALL )
Avoid deeply nested control flow statements. Open
Open
if ($tblStudent) {
if ($tblStudent->getIdentifierComplete() != '') {
$StudentNumber = $tblStudent->getIdentifierComplete();
}
}
Avoid deeply nested control flow statements. Open
Open
if ($tblObjectType->getIdentifier() === 'PERSON') {
$tblPerson = Person::useService()->getPersonById($objectId);
if ($tblPerson) {
$tblObject = $tblPerson;
$name = $tblPerson->getLastFirstName();
Avoid deeply nested control flow statements. Open
Open
if ($tblProspect) {
$tblProspectReservation = $tblProspect->getTblProspectReservation();
if ($tblProspectReservation) {
if ($filterYear) {
$year = trim($tblProspectReservation->getReservationYear());
Avoid deeply nested control flow statements. Open
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
Open
if ($tblListObjectElementList->getServiceTblObject()) {
if (!isset($Data[$tblListObjectElementList->getTblObjectType()->getId()]
[$tblListObjectElementList->getServiceTblObject()->getId()]
[$tblListObjectElementList->getTblListElementList()->getId()])
) {
Avoid deeply nested control flow statements. Open
Open
if ($tblProspectReservation) {
$filterYear = trim($tblProspectReservation->getReservationYear());
}
Avoid deeply nested control flow statements. Open
Open
if ($tblObject) {
$tblListObjectElementList = $this->getListObjectElementListByListAndObjectTypeAndListElementListAndObject(
$tblList, $tblObjectType, $tblObject
);
if ($tblListObjectElementList) {
Avoid deeply nested control flow statements. Open
Open
if (!empty($FilterGroup)) {
foreach ($FilterGroup as $FieldName => $FilterList) {
foreach ($FilterList as $FilterNumber => $FieldValue) {
if ($FieldValue) {
( new Data($this->getBinding()) )->createFilterField($tblSerialLetter, $tblFilterCategory,
Avoid deeply nested control flow statements. Open
Open
if ($tblRelationship->getTblType()) {
$Data['Type'] = $tblRelationship->getTblType()->getName();
}