DerDu/SPHERE-Framework

View on GitHub

Showing 5,014 of 7,620 total issues

Avoid deeply nested control flow statements.
Open

                                        if ($subjectReligion === 'ETH') {
                                            $tblSubject = Subject::useService()->getSubjectByAcronym('ETH');
                                        } elseif ($subjectReligion === 'RE/e') {
                                            $tblSubject = Subject::useService()->getSubjectByAcronym('REV');
                                        }
Severity: Major
Found in Application/Transfer/Import/Zwickau/Service.php - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                                            if ($focus === 'HÖ') {
                                                $tblStudentFocusType = Student::useService()->getStudentFocusTypeByName('Hören');
                                                Student::useService()->addStudentFocus($tblStudent,
                                                    $tblStudentFocusType);
                                            }
    Severity: Major
    Found in Application/Transfer/Import/Zwickau/Service.php - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                          if ($pos !== false) {
                                              $cityCode = trim(substr($cityName, 0, $pos));
                                              $cityName = trim(substr($cityName, $pos + 1));
      
                                              $pos = strpos($cityName, " OT ");
      Severity: Major
      Found in Application/Transfer/Import/BadDueben/Service.php - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                                if (strpos($phone, 'P') !== false) {
                                                    $remarkPhone = 'Vater';
                                                    $phone = trim(str_replace('P', '', $phone));
                                                }
        Severity: Major
        Found in Application/Transfer/Import/BadDueben/Service.php - About 45 mins to fix

          Avoid deeply nested control flow statements.
          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));
          Severity: Major
          Found in Application/Transfer/Import/Zwickau/Service.php - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                                if ($day !== '') {
                                                    $reservationDate = date('d.m.Y', \PHPExcel_Shared_Date::ExcelToPHP($day));
                                                }
            Severity: Major
            Found in Application/Transfer/Import/BadDueben/Service.php - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                                  if (isset($nameArrayCustody2[1])) {
                                                      $lastNameCustody2 = $nameArrayCustody2[1];
                                                  }
              Severity: Major
              Found in Application/Transfer/Import/BadDueben/Service.php - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                                        if (0 === strpos($phoneNumber, '01')) {
                                                            $tblType = Phone::useService()->getTypeById(2);
                                                        }
                Severity: Major
                Found in Application/Transfer/Import/BadDueben/Service.php - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                                          if ($tblSubject) {
                                                              Student::useService()->addStudentSubject(
                                                                  $tblStudent,
                                                                  Student::useService()->getStudentSubjectTypeByIdentifier('RELIGION'),
                                                                  Student::useService()->getStudentSubjectRankingByIdentifier('1'),
                  Severity: Major
                  Found in Application/Transfer/Import/BadDueben/Service.php - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                            if (0 === strpos($phoneNumber, '01')) {
                                                                $tblType = Phone::useService()->getTypeById(4);
                                                            }
                    Severity: Major
                    Found in Application/Transfer/Import/Coswig/Service.php - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                          if (isset($nameArrayCustody2[0])) {
                                                              $firstNameCustody2 = $nameArrayCustody2[0];
                                                          }
                      Severity: Major
                      Found in Application/Transfer/Import/BadDueben/Service.php - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                                if (0 === strpos($phone, '01')) {
                                                                    $tblType = Phone::useService()->getTypeById(2);
                                                                }
                        Severity: Major
                        Found in Application/Transfer/Import/BadDueben/Service.php - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                                  if ($tblLevel) {
                                                                      $tblDivision = Division::useService()->insertDivision($tblYear, $tblLevel,
                                                                          '');
                                                                  }
                          Severity: Major
                          Found in Application/Transfer/Import/Coswig/Service.php - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                                    if (0 === strpos($phoneNumber, '01')) {
                                                                        $tblType = Phone::useService()->getTypeById(2);
                                                                    }
                            Severity: Major
                            Found in Application/Transfer/Import/Seelitz/Service.php - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                              if ($streetName && $streetNumber && $zipCode && $city) {
                                                                  Address::useService()->insertAddressToCompany(
                                                                      $tblCompany,
                                                                      $streetName,
                                                                      $streetNumber,
                              Severity: Major
                              Found in Application/Transfer/Import/Zwickau/Service.php - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                                        if ($tblLevel) {
                                                                            $tblDivision = Division::useService()->insertDivision(
                                                                                $tblYear,
                                                                                $tblLevel,
                                                                                $division
                                Severity: Major
                                Found in Application/Transfer/Import/Zwickau/Service.php - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                                  if (($Number = trim($Document->getValue($Document->getCell($Location['Telefon dienstlich'],
                                                                          $RunY)))) != ''
                                                                  ) {
                                                                      $tblType = Phone::useService()->getTypeById(3);
                                                                      if (0 === strpos($Number, '01')) {
                                  Severity: Major
                                  Found in Application/Transfer/Import/Braeunsdorf/Service.php - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                                    if($tblInvoiceItem->getId() == $tblItem->getId()){
                                                                        $isInvoice = true;
                                                                    }
                                    Severity: Major
                                    Found in Application/Billing/Bookkeeping/Invoice/Service.php - About 45 mins to fix

                                      Function getDatevRemark has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          public function getDatevRemark($ignoreDefault = false)
                                          {
                                      
                                              if($ignoreDefault){
                                                  return $this->DatevRemark;
                                      Severity: Minor
                                      Found in Application/Billing/Inventory/Item/Service/Entity/TblItem.php - About 45 mins to fix

                                      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

                                          public function createInvoiceList($InvoiceList, $Month, $Year, $TargetTime, $BillTime, TblBasket $tblBasket)
                                      Severity: Minor
                                      Found in Application/Billing/Bookkeeping/Invoice/Service/Data.php - About 45 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language