Showing 5,014 of 7,620 total issues
Method getFormFieldSelectBox
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
protected function getFormFieldSelectBox( $Data, $PropertyName, $Label = null, $Icon = null, $doResetCount = false, $doKeyConvertToText = true) {
Function createColumn
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
final protected function createColumn(Table $Table, $Name, $Type = self::FIELD_TYPE_STRING, $IsNull = false, $Default = null)
{
if (!$this->getConnection()->hasColumn($Table->getName(), $Name)) {
if( $Default === null ) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Consider simplifying this complex logical expression. Open
Open
if (($tblType = $tblToPerson->getTblType())
&& ($tblType->getName() == 'Sorgeberechtigt'
|| $tblType->getName() == 'Bevollmächtigt'
|| $tblType->getName() == 'Geschwisterkind'
|| $tblType->getName() == 'Ehepartner'
Consider simplifying this complex logical expression. Open
Open
if (($tblPrepareAdditionalGradeType = Prepare::useService()->getPrepareAdditionalGradeTypeByIdentifier('VERBAL_EXAM'))
&& ($verbalExamGrade = Prepare::useService()->getPrepareAdditionalGradeByRanking(
$this->getTblPrepareCertificate(),
$tblPerson,
$tblPrepareAdditionalGradeType,
Consider simplifying this complex logical expression. Open
Open
if (($tblPerson = Person::useService()->getPersonById($personId))
&& ($tblStudent = $tblPerson->getStudent())
&& ($tblStudentSubjectType = Student::useService()->getStudentSubjectTypeByIdentifier('RELIGION'))
&& ($tblStudentSubjectRanking = Student::useService()->getStudentSubjectRankingByIdentifier('1'))
&& ($tblStudentSubject = Student::useService()->getStudentSubjectByStudentAndSubjectAndSubjectRanking($tblStudent,
Consider simplifying this complex logical expression. Open
Open
if (($tblDivision = $this->getTblDivision())
&& ($tblLevel = $tblDivision->getTblLevel())
&& intval($tblLevel->getName()) > 6
&& ($tblPerson = Person::useService()->getPersonById($personId))
&& ($tblStudent = $tblPerson->getStudent())
Consider simplifying this complex logical expression. Open
Open
if ($tblPerson
&& ($tblStudent = $tblPerson->getStudent())
&& ($tblStudentSubjectType = Student::useService()->getStudentSubjectTypeByIdentifier('RELIGION'))
&& ($tblStudentSubjectRanking = Student::useService()->getStudentSubjectRankingByIdentifier('1'))
&& ($tblStudentSubject = Student::useService()->getStudentSubjectByStudentAndSubjectAndSubjectRanking($tblStudent,
Consider simplifying this complex logical expression. Open
Open
if (
$FilterGroup === null
&& $FilterStudent === null
&& $FilterPerson === null
&& $FilterYear === null
Consider simplifying this complex logical expression. Open
Open
if ($FilterGroup === null && $FilterStudent === null && $FilterYear === null
&& $FilterProspect === null && $FilterCompany === null && $FilterRelationship === null
) {
if ($tblFilterFieldList) {
foreach ($tblFilterFieldList as $tblFilterField) {
Consider simplifying this complex logical expression. Open
Open
if ($filterYear && $filterLevel && $filterSchoolOption) {
if ($hasYear && $hasLevel && $hasSchoolOption) {
$resultList[$tblObjectType->getId()][$tblPerson->getId()]
= $tblPerson->getLastFirstName();
}
Consider simplifying this complex logical expression. Open
Open
if ((isset($Result['FileTeacher1']) && $Result['FileTeacher1'] == '')
&& (isset($Result['FileTeacher2']) && $Result['FileTeacher2'] == '')
&& (isset($Result['FileTeacher3']) && $Result['FileTeacher3'] == '')
) {
$this->createIndiwareImportLectureship($Manager, $tblYear, $tblAccount, $Result, 1,
Consider simplifying this complex logical expression. Open
Open
if($isCustody && preg_match('!^Klasse*!', $Group)){
// don't insert group for Custody!
} elseif($isCustody && $Group !== '') {
$tblGroup = Group::useService()->createGroupFromImport($Group);
Group::useService()->addGroupPerson($tblGroup, $tblPerson);
Consider simplifying this complex logical expression. Open
Open
if ($isCustody && preg_match('!^Klasse*!', $Group)) {
// don't insert group for Custody!
} elseif ($isCustody && $Group !== '') {
$tblGroup = Group::useService()->createGroupFromImport($Group);
Group::useService()->addGroupPerson($tblGroup, $tblPerson);
Consider simplifying this complex logical expression. Open
Open
if (isset($Data['PrimaryFocus'])
&& isset($Data['SupportType'])
&& ($tblSupportType = Student::useService()->getSupportTypeById($Data['SupportType']))
&& ($tblSupportType->getName() == 'Förderantrag' || $tblSupportType->getName() == 'Förderbescheid')
&& !($tblPrimaryFocusType = Student::useService()->getSupportFocusTypeById($Data['PrimaryFocus']))
Consider simplifying this complex logical expression. Open
Open
if (($tblDivision = $tblDivisionSubject->getTblDivision())
&& $tblDivision->getServiceTblYear()
&& $tblYear->getId() == $tblDivision->getServiceTblYear()
&& ($tblSubject = $tblDivisionSubject->getServiceTblSubject())
&& ($tblDivisionSubjectSelected->getServiceTblSubject())
Consider simplifying this complex logical expression. Open
Open
if (($tblTask = $tblTest->getTblTask())
&& $tblTask->getFromDate()
&& $tblTask->getToDate()
&& ($fromDate = new \DateTime($tblTask->getFromDate()))
&& $now < $fromDate
Consider simplifying this complex logical expression. Open
Open
if ($Identifier == 'PROFILE'
|| $Identifier == 'RELIGION'
|| $Identifier == 'ORIENTATION'
|| $Identifier == 'FOREIGN_LANGUAGE'
|| $Identifier == 'ELECTIVE'
Consider simplifying this complex logical expression. Open
Open
if ($tblDivisionSubject && $tblDivisionSubject->getServiceTblSubject()
&& $tblDivisionSubject->getTblDivision()
&& ($tblDivisionSubject->getHasGrading() || (($tblSetting = Consumer::useService()->getSetting(
'Education', 'Graduation', 'Evaluation', 'HasBehaviorGradesForSubjectsWithNoGrading'
))
Consider simplifying this complex logical expression. Open
Open
if ($tblTest->getDate()
&& ($testDate = (new \DateTime($tblTest->getDate())))
&& ($toDateTimeTask = new \DateTime($appointedDateTask->getToDate()))
&& ($nowDateTime = (new \DateTime('now')))
&& $testDate <= $toDateTimeTask
Consider simplifying this complex logical expression. Open
Open
if ($filterYear && $filterLevel && $filterType) {
if ($hasYear && $hasLevel && $hasType) {
array_push($resultList, $tblDivisionSubject);
}
} elseif ($filterYear && $filterLevel) {