DerDu/SPHERE-Framework

View on GitHub

Showing 5,014 of 7,620 total issues

Avoid deeply nested control flow statements.
Open

                        if ($tblSchoolTypePrimary) {
                            $this->updateCertificate($tblCertificate, $tblCertificateTypeYear, $tblSchoolTypePrimary);
                            if (!$this->getCertificateLevelAllByCertificate($tblCertificate)) {
                                if (($tblLevel = Division::useService()->getLevelBy($tblSchoolTypePrimary, '3'))) {
                                    $this->createCertificateLevel($tblCertificate, $tblLevel);
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, 500);
                            }
    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, $tblCertificateTypeYear, $tblSchoolTypeSecondary);
                                  if (!$this->getCertificateLevelAllByCertificate($tblCertificate)) {
                                      if (($tblLevel = Division::useService()->getLevelBy($tblSchoolTypeSecondary, '5'))) {
                                          $this->createCertificateLevel($tblCertificate, $tblLevel);
      Severity: Major
      Found in Application/Education/Certificate/Generator/Service/Data.php - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if ($tblSchoolTypeGym) {
                                    $this->updateCertificate($tblCertificate, $tblCertificateTypeHalfYear,
                                        $tblSchoolTypeGym, null, true);
                                    if (!$this->getCertificateLevelAllByCertificate($tblCertificate)) {
                                        if (($tblLevel = Division::useService()->getLevelBy($tblSchoolTypeGym, '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 (!$this->getCertificateFieldByCertificateAndField($tblCertificate, $FieldName)) {
                                      $this->createCertificateField($tblCertificate, $FieldName, 2500);
                                  }
          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->getCertificateLevelAllByCertificate($tblCertificate)) {
                                        if (($tblLevel = Division::useService()->getLevelBy($tblSchoolTypeGym, '10'))) {
                                            $this->createCertificateLevel($tblCertificate, $tblLevel);
                                        }
                                    }
            Severity: Major
            Found in Application/Education/Certificate/Generator/Service/Data.php - About 45 mins to fix

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

                      TblPerson $tblPerson,
                      TblSubject $tblSubject,
                      TblSubjectGroup $tblSubjectGroup,
                      TblDivisionSubject $tblDivisionSubject,
                      $list,
              Severity: Minor
              Found in Application/Education/Lesson/Division/Filter/Filter.php - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if (!$this->getCertificateFieldByCertificateAndField($tblCertificate, $FieldName)) {
                                            $this->createCertificateField($tblCertificate, $FieldName, 1000);
                                        }
                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 ($tblSchoolTypePrimary) {
                                                $this->updateCertificate($tblCertificate, $tblCertificateTypeHalfYear, $tblSchoolTypePrimary, null, true);
                                                if (!$this->getCertificateLevelAllByCertificate($tblCertificate)) {
                                                    if (($tblLevel = Division::useService()->getLevelBy($tblSchoolTypePrimary, '2'))) {
                                                        $this->createCertificateLevel($tblCertificate, $tblLevel);
                    Severity: Major
                    Found in Application/Education/Certificate/Generator/Service/Data.php - About 45 mins to fix

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

                          public function getDivisionSelectStage(
                              Stage $Stage,
                              $tblDivisionList,
                              $BasicRoute = '/Education/ClassRegister/Teacher',
                              $tblYear = false,
                      Severity: Minor
                      Found in Application/Education/ClassRegister/ClassRegister.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

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

                          public function getDivisionStudentAllByPerson(TblPerson $tblPerson, $isForced = false)
                          {
                      
                              if ($isForced) {
                                  $EntityList = $this->getForceEntityListBy(__METHOD__, $this->getConnection()->getEntityManager(),
                      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, 1000);
                                              }
                      Severity: Major
                      Found in Application/Education/Certificate/Generator/Service/Data.php - About 45 mins to fix

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

                                TblPerson $tblPerson,
                                TblSubject $tblSubject,
                                TblSubjectGroup $tblSubjectGroup,
                                TblDivisionSubject $tblDivisionSubject,
                                $list,
                        Severity: Minor
                        Found in Application/Education/Lesson/Division/Filter/Filter.php - About 45 mins to fix

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

                                  IFormInterface $Form,
                                  $Group,
                                  $Id,
                                  $DivisionId,
                                  $DivisionSubjectId,
                          Severity: Minor
                          Found in Application/Education/Lesson/Division/Service.php - About 45 mins to fix

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

                                public function updateDivisionSubject(
                                    IFormInterface $Form,
                                    TblDivision $tblDivision,
                                    $Data
                                ) {
                            Severity: Minor
                            Found in Application/Education/Lesson/Division/Service.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 addSubjectToDivisionWithGroup has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    IFormInterface $Form,
                                    TblDivision $tblDivision,
                                    TblSubject $tblSubject,
                                    $Group,
                                    $DivisionSubjectId,
                            Severity: Minor
                            Found in Application/Education/Lesson/Division/Service.php - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                                      if ($this->exitsSubjectStudent($item, $tblPerson)) {
                                                                          $resultList[$item->getId()] = $item;
                                                                      }
                              Severity: Major
                              Found in Application/Education/Lesson/Division/Service.php - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                            if (!$SubjectTeacherList && !$tblSubjectTeacherList) {
                                                                $TeacherGroupCount++;
                                                            }
                                Severity: Major
                                Found in Application/Education/Lesson/Division/Service.php - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                                      if ($tblDivision->getServiceTblYear()
                                                                          && $tblYear->getId() === $tblDivision->getServiceTblYear()->getId()
                                                                      ) {
                                                                          $DivisionList[] = $tblDivision;
                                                                      }
                                  Severity: Major
                                  Found in Application/Education/Lesson/Division/Service.php - About 45 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language