DerDu/SPHERE-Framework

View on GitHub

Showing 5,014 of 7,620 total issues

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

    public function countDivisionSubjectAllByDivision(TblDivision $tblDivision)
    {
        // Todo GCK getCachedCountBy anpassen --> ignorieren von removed entities bei Verkn�pfungstabelle
//        $result = $this->getCachedCountBy(__METHOD__, $this->getConnection()->getEntityManager(), 'TblDivisionSubject',
//            array(TblDivisionSubject::ATTR_TBL_DIVISION => $tblDivision->getId()));
Severity: Minor
Found in Application/Education/Lesson/Division/Service/Data.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

Avoid deeply nested control flow statements.
Open

                        if (!$this->getCertificateFieldByCertificateAndField($tblCertificate, $FieldName)){
                            $this->createCertificateField($tblCertificate, $FieldName, 270);
                        }
Severity: Major
Found in Application/Education/Certificate/Generator/Service/Data.php - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if (!$this->getCertificateFieldByCertificateAndField($tblCertificate, $FieldName)){
                                $this->createCertificateField($tblCertificate, $FieldName, 300);
                            }
    Severity: Major
    Found in Application/Education/Certificate/Generator/Service/Data.php - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                      if ($tblCourse) {
                                          $course = $tblCourse->getName();
                                      }
      Severity: Major
      Found in Application/Education/ClassRegister/ClassRegister.php - About 45 mins to fix

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

            public function countDivisionTeacherAllByDivision(TblDivision $tblDivision)
            {
        
                // Todo GCK getCachedCountBy anpassen --> ignorieren von removed entities bei Verkn�pfungstabelle
        //        $result = $this->getCachedCountBy(__METHOD__, $this->getConnection()->getEntityManager(), 'TblDivisionTeacher',
        Severity: Minor
        Found in Application/Education/Lesson/Division/Service/Data.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

        Avoid deeply nested control flow statements.
        Open

                                if ($tblSchoolTypeSecondary) {
                                    $this->updateCertificate($tblCertificate, $tblCertificateTypeHalfYear,
                                        $tblSchoolTypeSecondary, null, true);
                                    if (!$this->getCertificateLevelAllByCertificate($tblCertificate)) {
                                        if (($tblLevel = Division::useService()->getLevelBy($tblSchoolTypeSecondary, '5'))) {
        Severity: Major
        Found in Application/Education/Certificate/Generator/Service/Data.php - About 45 mins to fix

          Method createAbsence has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  TblPerson $tblPerson,
                  TblDivision $tblDivision,
                  $FromDate,
                  $ToDate,
                  $Status,
          Severity: Minor
          Found in Application/Education/ClassRegister/Absence/Service/Data.php - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if (!$this->getCertificateSubjectAll($tblCertificate)) {
                                        $this->setCertificateSubject($tblCertificate, 'DE', 1, 1);
                                        $this->setCertificateSubject($tblCertificate, 'EN', 1, 2);
                                        $this->setCertificateSubject($tblCertificate, 'KU', 1, 3);
                                        $this->setCertificateSubject($tblCertificate, 'MU', 1, 4);
            Severity: Major
            Found in Application/Education/Certificate/Generator/Service/Data.php - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if ($tblSchoolTypePrimary) {
                                          $this->updateCertificate($tblCertificate, $tblCertificateTypeYear,
                                              $tblSchoolTypePrimary,
                                              null, false);
                                          if (($tblLevel = Division::useService()->getLevelBy($tblSchoolTypePrimary, '1'))) {
              Severity: Major
              Found in Application/Education/Certificate/Generator/Service/Data.php - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if (!$this->getCertificateFieldByCertificateAndField($tblCertificate, $FieldName)) {
                                            $this->createCertificateField($tblCertificate, $FieldName, 3600);
                                        }
                Severity: Major
                Found in Application/Education/Certificate/Generator/Service/Data.php - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if (!$this->getCertificateGradeAll($tblCertificate)) {
                                              $this->setCertificateGradeAllStandard($tblCertificate);
                                          }
                  Severity: Major
                  Found in Application/Education/Certificate/Generator/Service/Data.php - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if ($tblSchoolTypeSecondary) {
                                                $this->updateCertificate($tblCertificate, $tblCertificateTypeHalfYear,
                                                    $tblSchoolTypeSecondary,
                                                    null, true);
                                                if (!$this->getCertificateLevelAllByCertificate($tblCertificate)) {
                    Severity: Major
                    Found in Application/Education/Certificate/Generator/Service/Data.php - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if (!$this->getCertificateSubjectAll($tblCertificate)) {
                                                  $this->setCertificateSubject($tblCertificate, 'DE', 1, 1);
                                                  $this->setCertificateSubject($tblCertificate, 'EN', 1, 2);
                                                  $this->setCertificateSubject($tblCertificate, 'KU', 1, 3);
                                                  $this->setCertificateSubject($tblCertificate, 'MU', 1, 4);
                      Severity: Major
                      Found in Application/Education/Certificate/Generator/Service/Data.php - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if ($tblSchoolTypeSecondary) {
                                                    $this->updateCertificate($tblCertificate, $tblCertificateTypeHalfYear,
                                                        $tblSchoolTypeSecondary, null, true);
                                                    if (!$this->getCertificateLevelAllByCertificate($tblCertificate)) {
                                                        if (($tblLevel = Division::useService()->getLevelBy($tblSchoolTypeSecondary, '5'))) {
                        Severity: Major
                        Found in Application/Education/Certificate/Generator/Service/Data.php - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if ($tblSchoolTypeSecondary) {
                                                      $this->updateCertificate($tblCertificate, $tblCertificateTypeHalfYear,
                                                          $tblSchoolTypeSecondary, null, true);
                                                      if (!$this->getCertificateLevelAllByCertificate($tblCertificate)) {
                                                          if (($tblLevel = Division::useService()->getLevelBy($tblSchoolTypeSecondary, '7'))) {
                          Severity: Major
                          Found in Application/Education/Certificate/Generator/Service/Data.php - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    if (!$this->getCertificateSubjectAll($tblCertificate)) {
                                                        $this->setCertificateSubject($tblCertificate, 'DE', 1, 1);
                                                        $this->setCertificateSubject($tblCertificate, 'EN', 1, 2);
                            
                                                        $this->setCertificateSubject($tblCertificate, 'TSCN', 1, 3, false);
                            Severity: Major
                            Found in Application/Education/Certificate/Generator/Service/Data.php - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      if (!$this->getCertificateSubjectAll($tblCertificate)) {
                                                          $this->setCertificateSubject($tblCertificate, 'DE', 1, 1);
                                                          $this->setCertificateSubject($tblCertificate, 'EN', 1, 2);
                                                          $this->setCertificateSubject($tblCertificate, 'KU', 1, 3);
                                                          $this->setCertificateSubject($tblCertificate, 'MU', 1, 4);
                              Severity: Major
                              Found in Application/Education/Certificate/Generator/Service/Data.php - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        if ($tblCertificate && !$this->getCertificateGradeAll($tblCertificate)) {
                                                            $this->setCertificateGradeAllStandard($tblCertificate);
                                                        }
                                Severity: Major
                                Found in Application/Education/Certificate/Generator/Service/Data.php - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                          if (!$this->getCertificateFieldByCertificateAndField($tblCertificate, $FieldName)) {
                                                              $this->createCertificateField($tblCertificate, $FieldName, 2700);
                                                          }
                                  Severity: Major
                                  Found in Application/Education/Certificate/Generator/Service/Data.php - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                            if (!$this->getCertificateFieldByCertificateAndField($tblCertificate, $FieldName)) {
                                                                $this->createCertificateField($tblCertificate, $FieldName, 2600);
                                                            }
                                    Severity: Major
                                    Found in Application/Education/Certificate/Generator/Service/Data.php - About 45 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language