Showing 5,014 of 7,620 total issues
Avoid deeply nested control flow statements. Open
Open
if (($tblCourseTransfer = $tblStudentTransfer->getServiceTblCourse())) {
if($tblCourseTransfer->getName() == 'Hauptschule') {
$identifier = 'SecondarySchoolHs';
} elseif ($tblCourseTransfer->getName() == 'Realschule') {
$identifier = 'SecondarySchoolRs';
Avoid deeply nested control flow statements. Open
Open
if (!isset($SearchList[4]) || empty($SearchList[4])) {
$Node4 = (new \ReflectionObject($ProbeList[4]->getEntity()))->newInstanceWithoutConstructor();
$Node4->__set($this->getPath(4)[0], $Key);
$MatchList = array(
$Node4
Avoid deeply nested control flow statements. Open
Open
if (!empty($MatchList)) {
/** @var AbstractView $Node5 */
foreach ($MatchList as $Node5) {
$Key = $Node5->__get($this->getPath(5)[1]);
if (!($MatchList = $this->filterNodeList($Key, $List, 6))) {
Avoid deeply nested control flow statements. Open
Open
if ($tblYearList) {
foreach ($tblYearList as $tblYear) {
$tblDivision = Division::useService()->getDivisionByPersonAndYear($tblPerson, $tblYear);
if ($tblDivision && $tblDivision->getTblLevel()) {
$Global->POST['Data']['SchoolEntryDivision'] = $tblDivision->getTblLevel()->getName();
Avoid deeply nested control flow statements. Open
Open
if ($this->checkTimeout()) {
throw new NodeException();
}
Function getDivisionByDivisionNameAndLevelAndYear
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
public function getDivisionByDivisionNameAndLevelAndYear($Name, TblLevel $tblLevel = null, TblYear $tblYear)
{
if ($tblYear && $tblLevel && $Name != '') {
$tblDivisionList = array();
- 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 ($SubjectTeacherList) {
$TeacherGroup[] = true;
}
Avoid deeply nested control flow statements. Open
Open
if ((count($tblDivisionSubjectActiveList) - 1) == count($TeacherGroup)) {
$SubjectUsedCount--;
}
Avoid deeply nested control flow statements. Open
Open
if ($tblAddressCustody) {
$Global->POST['Data']['CustodyAddress'] = $tblAddressCustody->getGuiString();
}
Avoid deeply nested control flow statements. Open
Open
if ($tblYearList) {
foreach ($tblYearList as $tblYear) {
$tblDivision = Division::useService()->getDivisionByPersonAndYear($tblPerson, $tblYear);
if ($tblDivision && $tblDivision->getTblLevel()) {
$Global->POST['Data']['SchoolEntryDivision'] = $tblDivision->getTblLevel()->getName();
Avoid deeply nested control flow statements. Open
Open
if ($LastDate && new \DateTime($LastDate) < new \DateTime($tblPeriod->getToDate())) {
$LastDate = $tblPeriod->getToDate();
} elseif (!$LastDate) {
$LastDate = $tblPeriod->getToDate();
}
Avoid deeply nested control flow statements. Open
Open
if ($tblToPersonList) {
foreach ($tblToPersonList as $tblToPerson) {
if ($tblType = $tblToPerson->getTblType()) {
$TypeName = $tblType->getName();
$TypeDescription = $tblType->getDescription();
Avoid deeply nested control flow statements. Open
Open
if ($tblAddressSchool) {
$Global->POST['Data']['SchoolAddressStreet'] = $tblAddressSchool->getStreetName().' '.$tblAddressSchool->getStreetNumber();
$tblCitySchool = $tblAddressSchool->getTblCity();
if ($tblCitySchool) {
$Global->POST['Data']['SchoolAddressDistrict'] = $tblCitySchool->getDistrict();
Method setStudentFocus
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
TblPerson $tblPerson,
TblLevel $tblLevel,
&$Content,
$gender,
$hasMigrationBackground,
Method countDivisionStudentsForSecondarySchool
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
&$countDivisionStudents,
TblDivision $tblDivision,
TblLevel $tblLevel,
TblCourse $tblCourse = null,
$gender,
Avoid deeply nested control flow statements. Open
Open
if (($MatchList = $this->filterNodeList($Key, $List, 5))) {
/** @var AbstractView $Node5 */
foreach ($MatchList as $Node5) {
$Result[] = array(
$Node0,
Function __construct
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
public function __construct(Identifier $Identifier)
{
$this->Identifier = $Identifier;
$Register = new Register();
- 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 ($tblToPersonList) {
foreach ($tblToPersonList as $tblToPerson) {
if ($tblType = $tblToPerson->getTblType()) {
$TypeName = $tblType->getName();
$TypeDescription = $tblType->getDescription();
Method getFormFieldAutoCompleter
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
protected function getFormFieldAutoCompleter( $Data, $PropertyName, $Placeholder = null, $Label = null, $Icon = null, $doResetCount = false ) {
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$CountHit = -1,
$CountMiss = -1,
$SizeAvailable = -1,
$SizeUsed = -1,
$SizeFree = -1,