Showing 5,014 of 7,620 total issues
Method createFile
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
TblBinary $tblBinary,
TblDirectory $tblDirectory,
TblFileType $tblFileType,
$Name,
$Description = '',
Function sanitizeNumber
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function sanitizeNumber( $Value ) {
if( is_numeric( $Value ) ) {
return (float)$Value;
} else {
- 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 ($tblYearList) {
foreach ($tblYearList as $tblYear) {
$tblDivision = Division::useService()->getDivisionByPersonAndYear($tblPerson, $tblYear);
if ($tblDivision && $tblDivision->getTblLevel()) {
$Global->POST['Data']['SchoolEntryDivision'] = $tblDivision->getTblLevel()->getName();
Function getCachedCountBy
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
final protected function getCachedCountBy($__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
if (!($MatchList = $this->filterNodeList($Key, $List, 5))) {
if (!isset($SearchList[5]) || empty($SearchList[5])) {
$Node5 = (new \ReflectionObject($ProbeList[5]->getEntity()))->newInstanceWithoutConstructor();
$Node5->__set($this->getPath(5)[0], $Key);
$MatchList = array(
Avoid deeply nested control flow statements. Open
if ($tblAddressSchool) {
$Global->POST['Data']['AddressStreet'] = $tblAddressSchool->getStreetName().' '.$tblAddressSchool->getStreetNumber();
$tblCitySchool = $tblAddressSchool->getTblCity();
if ($tblCitySchool) {
$Global->POST['Data']['AddressCity'] = $tblCitySchool->getCode().', '.$tblCitySchool->getName();
Avoid deeply nested control flow statements. Open
if ($tblPrepareStudent->isPrinted()
&& ($tblPerson = $tblPrepareStudent->getServiceTblPerson())
&& ((($tblPrepareInformationTransfer = Prepare::useService()->getPrepareInformationBy(
$tblPrepare, $tblPerson, 'Transfer'
))
Avoid deeply nested control flow statements. Open
if (($tblDivisionSubjectList = Division::useService()->getDivisionSubjectAllByPersonAndYear($tblPerson, $tblYear))) {
foreach ($tblDivisionSubjectList as $tblDivisionSubject) {
if (($tblSubjectTemp = $tblDivisionSubject->getServiceTblSubject())
&& Subject::useService()->isOrientation($tblSubjectTemp)
) {
Avoid deeply nested control flow statements. Open
if (($tblDivisionSubjectList = Division::useService()->getDivisionSubjectAllByPersonAndYear($tblPerson, $tblYear))) {
foreach ($tblDivisionSubjectList as $tblDivisionSubject) {
if (($tblSubjectTemp = $tblDivisionSubject->getServiceTblSubject())
&& Subject::useService()->isProfile($tblSubjectTemp)
) {
Avoid deeply nested control flow statements. Open
if ($value == 'nicht erteilt') {
$value = 'ne';
} elseif ($value == 'teilgenommen') {
$value = 't';
} elseif ($value == 'Keine Benotung') {
Avoid deeply nested control flow statements. Open
if (!($MatchList = $this->filterNodeList($Key, $List, 5))) {
if (!isset($SearchList[5]) || empty($SearchList[5])) {
$Node5 = (new \ReflectionObject($ProbeList[5]->getEntity()))->newInstanceWithoutConstructor();
$Node5->__set($this->getPath(5)[0], $Key);
$MatchList = array(
Method createDirectory
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
TblPartition $tblPartition,
$Name,
$Description,
TblDirectory $tblDirectory = null,
$IsLocked = false,
Avoid deeply nested control flow statements. Open
if ($tblSchoolEnrollmentType->getIdentifier() == 'PREMATURE') {
if (isset($Content['D01']['Premature'][$gender])) {
$Content['D01']['Premature'][$gender]++;
} else {
$Content['D01']['Premature'][$gender] = 1;
Avoid deeply nested control flow statements. Open
if ($this->checkTimeout()) {
throw new NodeException();
}
Avoid deeply nested control flow statements. Open
if(($tblSchoolList = School::useService()->getSchoolByType($tblType))){
// bei einer Schule kann diese genommen werden. (Normalfall)
if(count($tblSchoolList) == 1){
$tblSchool = current($tblSchoolList);
// Übernahme nur, wenn eine Unternehmensnummer hinterlegt ist
Avoid deeply nested control flow statements. Open
if ($MaxDate > new \DateTime($transferDate)) {
$DateString = $transferDate;
// correct leaveDate if necessary
$Global->POST['Data']['LeaveDate'] = $DateString;
}
Function frontendDivisionChange
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function frontendDivisionChange($Id = null, $Division = null)
{
$Stage = new Stage('Klasse', 'Bearbeiten');
$Stage->addButton(new Standard('Zurück', '/Education/Lesson/Division', 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
Method createDirectory
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
TblPartition $tblPartition,
$Name,
$Description,
TblDirectory $tblDirectory = null,
$IsLocked = false,
Avoid deeply nested control flow statements. Open
if ($hasMigrationBackground) {
if (isset($countMigrantsArray[$birthYear][$tblLevel->getName()][$gender])) {
$countMigrantsArray[$birthYear][$tblLevel->getName()][$gender]++;
} else {
$countMigrantsArray[$birthYear][$tblLevel->getName()][$gender] = 1;
Avoid deeply nested control flow statements. Open
if ($birthYear) {
if (isset($countArray[$birthYear]['Leave'][$gender])) {
$countArray[$birthYear]['Leave'][$gender]++;
} else {
$countArray[$birthYear]['Leave'][$gender] = 1;