Showing 5,014 of 7,620 total issues
Avoid deeply nested control flow statements. Open
if ($tblProspectReservation) {
$level = $tblProspectReservation->getReservationDivision();
$year = $tblProspectReservation->getReservationYear();
$optionA = $tblProspectReservation->getServiceTblTypeOptionA();
$optionB = $tblProspectReservation->getServiceTblTypeOptionB();
Function getGenderNameFromGenderOrSalutation
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getGenderNameFromGenderOrSalutation()
{
$genderString = $this->getGenderString();
if ($genderString == '') {
// Anrede prüfen
- 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 getContent
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$titleName,
$content,
$linkList = array(),
$titleDescription = '',
IIconInterface $titleIcon = null,
Avoid deeply nested control flow statements. Open
if (isset( $Meta['SubjectLevelFrom'] ) && isset( $Meta['SubjectLevelFrom'][$Category][$Ranking] )) {
if ($Meta['SubjectLevelFrom'][$Category][$Ranking]) {
$tblLevelFrom = Division::useService()->getLevelById($Meta['SubjectLevelFrom'][$Category][$Ranking]);
}
}
Method updateStudentBasic
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
TblStudent $tblStudent,
$Prefix = '',
$Identifier = '',
$SchoolAttendanceStartDate = '',
$HasMigrationBackground = false,
Avoid deeply nested control flow statements. Open
if ($divisionYear && $divisionYear->getId() == $tblYear->getId()) {
$tblDivisionList[] = $tblDivisionStudent->getTblDivision();
}
Method addPersonRelationshipToPerson
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
TblPerson $tblPersonFrom,
TblPerson $tblPersonTo,
TblType $tblType,
$Remark,
$Ranking = null,
Method addStudentSubject
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
TblStudent $tblStudent,
TblStudentSubjectType $tblStudentSubjectType,
TblStudentSubjectRanking $tblStudentSubjectRanking,
TblSubject $tblSubject,
TblLevel $tblLevelFrom = null,
Avoid deeply nested control flow statements. Open
if ($divisionYear && $divisionYear->getId() == $tblYear->getId()) {
if(($tblDivision = $tblDivisionStudent->getTblDivision())){
if (($tblLevel = $tblDivision->getTblLevel())
&& !$tblLevel->getIsChecked()
) {
Function formRelationshipToCompany
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function formRelationshipToCompany($PersonId, $ToCompanyId = null, $setPost = false, $Search = '', IMessageInterface $message = null)
{
if (!($tblPerson = Person::useService()->getPersonById($PersonId))) {
return false;
}
- 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 createStudentBasic
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
TblPerson $tblPerson,
$Prefix = '',
$Identifier = '',
$SchoolAttendanceStartDate = '',
$HasMigrationBackground = false,
Avoid deeply nested control flow statements. Open
if ($tblDivisionTeacher && $tblDivisionTeacher->getDescription() != '') {
$TeacherString .= ' ('.$tblDivisionTeacher->getDescription().')';
}
Avoid deeply nested control flow statements. Open
if ($tblDivisionStudent->getId() !== $tblDivisionStudentTemp->getId()
&& $tblDivisionStudentTemp->getTblDivision()
&& (
$tblDivisionStudentTemp->getTblDivision()->getTblLevel()
&& $tblDivisionStudent->getTblDivision()->getTblLevel()->getId()
Avoid deeply nested control flow statements. Open
if ($tblPersonList) {
foreach ($tblPersonList as $tblPerson) {
$TeacherAcronym = new ToolTip(new Small(new NotAvailable())
,
'Lehrer ' . $tblPerson->getLastFirstName() . ' besitzt kein Lehrerkürzel');
Function isAfterEditPeriod
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function isAfterEditPeriod()
{
if ($this->getFromDate()){
$toDate = $this->ToDate;
- 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 ($tblPeriod->getId() == $tblPeriodOrigin->getId()) {
if (isset($tblPeriodLinkList[$periodPosition])) {
$tblPeriodLink = $tblPeriodLinkList[$periodPosition];
}
break;
Avoid deeply nested control flow statements. Open
if (!$this->existsTestByTask($tblTask, $tblDivision,
$tblDivisionSubject->getServiceTblSubject())
) {
(new Data($this->getBinding()))->createTest(
$tblDivision,
Avoid deeply nested control flow statements. Open
if (($tblDivision = $tblDivisionSubject->getTblDivision())
&& $tblDivision->getServiceTblYear()
&& $tblYear->getId() == $tblDivision->getServiceTblYear()
&& ($tblSubject = $tblDivisionSubject->getServiceTblSubject())
&& ($tblDivisionSubjectSelected->getServiceTblSubject())
Avoid deeply nested control flow statements. Open
if ($TeacherString !== ' | ') {
$TeacherString .= ', ';
}
Avoid deeply nested control flow statements. Open
if ($now > $taskFromDate
&& $now < ($taskToDate->add(new \DateInterval('P1D')))
) {
$countGrades = 0;
if (($tblGradeList = Gradebook::useService()->getProposalBehaviorGradeAllBy($tblDivisionItem, $tblTask))) {