Showing 5,014 of 7,620 total issues
Method createFile
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
TblBinary $tblBinary,
TblDirectory $tblDirectory,
TblFileType $tblFileType,
$Name,
$Description = '',
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']['SchoolAddressCity'] = $tblCitySchool->getCode().' '.$tblCitySchool->getName();
Avoid deeply nested control flow statements. Open
Open
if ($isInPreparationDivisionForMigrants) {
if (isset($countArray[$birthYear]['Migration'][$gender])) {
$countArray[$birthYear]['Migration'][$gender]++;
} else {
$countArray[$birthYear]['Migration'][$gender] = 1;
Avoid deeply nested control flow statements. Open
Open
if (($MatchList = $this->filterNodeList($Key, $List, 5))) {
/** @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 (!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 ($tblAddressSchool) {
$Global->POST['Data']['SchoolAddressStreet'] = $tblAddressSchool->getStreetName().' '.$tblAddressSchool->getStreetNumber();
$tblCitySchool = $tblAddressSchool->getTblCity();
if ($tblCitySchool) {
$Global->POST['Data']['SchoolAddressCity'] = $tblCitySchool->getCode().' '.$tblCitySchool->getName();
Function getCachedEntityBy
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
final protected function getCachedEntityBy($__METHOD__, Manager $EntityManager, $EntityName, $Parameter)
{
// Only if NOT REMOVED
$Parameter['EntityRemove'] = 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
Avoid deeply nested control flow statements. Open
Open
if (!empty($MatchList)) {
/** @var AbstractView $Node5 */
foreach ($MatchList as $Node5) {
$Result[] = array(
$Node0,
Function getOtherDivisionsByStudent
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
public function getOtherDivisionsByStudent(
TblDivision $tblDivision,
TblPerson $tblPerson,
$withCurrentDivision = true
) {
- 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 ($tblSubjectTeacher->getServiceTblPerson()) {
(new Data($this->getBinding()))->addSubjectTeacher($tblDivisionSubjectCopy,
$tblSubjectTeacher->getServiceTblPerson());
}
Avoid deeply nested control flow statements. Open
Open
if (($tblDivisionSubjectTemp = $tblSubjectStudent->getTblDivisionSubject())
&& ($tblSubjectTemp = $tblDivisionSubjectTemp->getServiceTblSubject())
&& ($tblPerson = $tblSubjectStudent->getServiceTblPerson())
) {
if ($IsSekTwo) {
Avoid deeply nested control flow statements. Open
Open
if ($StudentSubject->getServiceTblSubject()->getName() == $tblSubject->getName()) {
$tblPersonList[] = $tblPersonStudent;
}
Avoid deeply nested control flow statements. Open
Open
if (($tblBirthdates = $tblCommonCustody->getTblCommonBirthDates())) {
if (($tblGenderCustody = $tblBirthdates->getTblCommonGender())) {
if ($tblGenderCustody->getName() == 'Weiblich') {
if (!isset($Global->POST['Data']['Custody'])) {
$tblAddressCustody = Address::useService()->getAddressByPerson($PersonCustody);
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 ($tblGender->getName() == 'Männlich') {
$maleList[] = $tblStudent;
continue;
} elseif ($tblGender->getName() == 'Weiblich') {
$femaleList[] = $tblStudent;
Method updatePeriod
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
TblPeriod $tblPeriod,
$Name,
$Description,
$From,
$To,
Avoid deeply nested control flow statements. Open
Open
if ($hasMigrationBackground) {
if (isset($Content['B01_1']['Leave']['L' . $certificate][$gender])) {
$Content['B01_1']['Leave']['L' . $certificate][$gender]++;
} else {
$Content['B01_1']['Leave']['L' . $certificate][$gender] = 1;
Avoid deeply nested control flow statements. Open
Open
if ($tblPrepareStudent->isPrinted()
&& ($tblPerson = $tblPrepareStudent->getServiceTblPerson())
&& ($tblCertificate = $tblPrepareStudent->getServiceTblCertificate())
) {
Avoid deeply nested control flow statements. Open
Open
if ($tblSubjectStudent->getServiceTblPerson()) {
if (($tblPerson = $tblSubjectStudent->getServiceTblPerson())) {
if ($tblSubject->getName() == 'Deutsch' || $tblSubject->getName() == 'Mathematik') {
$personAdvancedCourseList[$tblLevel->getName()][$tblPerson->getId()][0]
Avoid deeply nested control flow statements. Open
Open
if (($tblPerson = $tblSubjectStudent->getServiceTblPerson())
&& ($tblCommon = Common::useService()->getCommonByPerson($tblPerson))
&& ($tblCommonBirthDates = $tblCommon->getTblCommonBirthDates())
&& ($tblCommonGender = $tblCommonBirthDates->getTblCommonGender())
) {