Showing 5,014 of 7,620 total issues
Avoid deeply nested control flow statements. Open
Open
if ($subjectReligion === 'ETH') {
$tblSubject = Subject::useService()->getSubjectByAcronym('ETH');
} elseif ($subjectReligion === 'RE/e') {
$tblSubject = Subject::useService()->getSubjectByAcronym('REV');
}
Avoid deeply nested control flow statements. Open
Open
if ($focus === 'HÖ') {
$tblStudentFocusType = Student::useService()->getStudentFocusTypeByName('Hören');
Student::useService()->addStudentFocus($tblStudent,
$tblStudentFocusType);
}
Avoid deeply nested control flow statements. Open
Open
if ($pos !== false) {
$cityCode = trim(substr($cityName, 0, $pos));
$cityName = trim(substr($cityName, $pos + 1));
$pos = strpos($cityName, " OT ");
Avoid deeply nested control flow statements. Open
Open
if (strpos($phone, 'P') !== false) {
$remarkPhone = 'Vater';
$phone = trim(str_replace('P', '', $phone));
}
Avoid deeply nested control flow statements. Open
Open
if (preg_match_all('!\d+!', $street, $matches)) {
$pos = strpos($street, $matches[0][0]);
if ($pos !== null) {
$streetName = trim(substr($street, 0, $pos));
$streetNumber = trim(substr($street, $pos));
Avoid deeply nested control flow statements. Open
Open
if ($day !== '') {
$reservationDate = date('d.m.Y', \PHPExcel_Shared_Date::ExcelToPHP($day));
}
Avoid deeply nested control flow statements. Open
Open
if (isset($nameArrayCustody2[1])) {
$lastNameCustody2 = $nameArrayCustody2[1];
}
Avoid deeply nested control flow statements. Open
Open
if (0 === strpos($phoneNumber, '01')) {
$tblType = Phone::useService()->getTypeById(2);
}
Avoid deeply nested control flow statements. Open
Open
if ($tblSubject) {
Student::useService()->addStudentSubject(
$tblStudent,
Student::useService()->getStudentSubjectTypeByIdentifier('RELIGION'),
Student::useService()->getStudentSubjectRankingByIdentifier('1'),
Avoid deeply nested control flow statements. Open
Open
if (0 === strpos($phoneNumber, '01')) {
$tblType = Phone::useService()->getTypeById(4);
}
Avoid deeply nested control flow statements. Open
Open
if (isset($nameArrayCustody2[0])) {
$firstNameCustody2 = $nameArrayCustody2[0];
}
Avoid deeply nested control flow statements. Open
Open
if (0 === strpos($phone, '01')) {
$tblType = Phone::useService()->getTypeById(2);
}
Avoid deeply nested control flow statements. Open
Open
if ($tblLevel) {
$tblDivision = Division::useService()->insertDivision($tblYear, $tblLevel,
'');
}
Avoid deeply nested control flow statements. Open
Open
if (0 === strpos($phoneNumber, '01')) {
$tblType = Phone::useService()->getTypeById(2);
}
Avoid deeply nested control flow statements. Open
Open
if ($streetName && $streetNumber && $zipCode && $city) {
Address::useService()->insertAddressToCompany(
$tblCompany,
$streetName,
$streetNumber,
Avoid deeply nested control flow statements. Open
Open
if ($tblLevel) {
$tblDivision = Division::useService()->insertDivision(
$tblYear,
$tblLevel,
$division
Avoid deeply nested control flow statements. Open
Open
if (($Number = trim($Document->getValue($Document->getCell($Location['Telefon dienstlich'],
$RunY)))) != ''
) {
$tblType = Phone::useService()->getTypeById(3);
if (0 === strpos($Number, '01')) {
Avoid deeply nested control flow statements. Open
Open
if($tblInvoiceItem->getId() == $tblItem->getId()){
$isInvoice = true;
}
Function getDatevRemark
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
public function getDatevRemark($ignoreDefault = false)
{
if($ignoreDefault){
return $this->DatevRemark;
- 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 createInvoiceList
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function createInvoiceList($InvoiceList, $Month, $Year, $TargetTime, $BillTime, TblBasket $tblBasket)