DerDu/SPHERE-Framework

View on GitHub

Showing 5,014 of 7,620 total issues

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

    public function isBeforeEditPeriod()
    {

        if ($this->getFromDate()){
            $fromDate = $this->FromDate;
Severity: Minor
Found in Application/Education/Graduation/Evaluation/Service/Entity/TblTask.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 setTableTask has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    private function setTableTask(Schema &$Schema, Table $tblTestType)
    {

        $Table = $this->getConnection()->createTable($Schema, 'tblTask');
        if (!$this->getConnection()->hasColumn('tblTask', 'Name')) {
Severity: Minor
Found in Application/Education/Graduation/Evaluation/Service/Setup.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 ($tblStudentSubject->getTblStudentSubjectRanking()->getId() == $Rank) {
                                $Global = $this->getGlobal();
                                if ($tblStudentSubject->getServiceTblLevelFrom()) {
                                    $Global->POST['Meta']['SubjectLevelFrom'][$tblStudentSubjectType->getId()][$tblStudentSubjectRanking->getId()]
                                        = $tblStudentSubject->getServiceTblLevelFrom()->getId();
Severity: Major
Found in Application/People/Person/Frontend/FrontendStudentSubject.php - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                                        if ($tblDivision) {
                                            $behaviorTaskAddList[] = array(
                                                'tblTask' => $tblTask,
                                                'tblDivision' => $tblDivision,
                                                'tblGradeType' => $tblGradeType
    Severity: Major
    Found in Application/Education/Graduation/Evaluation/Service.php - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                      if ($tblPersonListMain) {
                                          foreach ($tblPersonListMain as $tblPerson) {
                                              $TeacherAcronym = new ToolTip(new Small(new NotAvailable())
                                                  ,
                                                  'Lehrer ' . $tblPerson->getLastFirstName() . ' besitzt kein Lehrerkürzel');
      Severity: Major
      Found in Application/Education/Graduation/Evaluation/Service.php - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                        if ($tblCommonBirthDates) {
                                            if ($tblCommonBirthDates->getBirthday() != '') {
                                                $BirthDay = $tblCommonBirthDates->getBirthday();
                                            }
                                        }
        Severity: Major
        Found in Application/People/Person/Frontend/FrontendBasic.php - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                          if ($tblTeacher) {
                                              $TeacherString .= new Bold($tblTeacher->getAcronym().' ');
                                          }
          Severity: Major
          Found in Application/People/Person/Frontend/FrontendStudentProcess.php - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                            if (($tblSubjectStudent->getServiceTblPerson())) {
                                                $countPersons++;
                                            }
            Severity: Major
            Found in Application/Education/Graduation/Evaluation/Service.php - About 45 mins to fix

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

                  public static function setYearAndDivisionForMassReplace(TblPerson $tblPerson, &$Year, &$Division)
                  {
                      $Year[ViewYear::TBL_YEAR_ID] = '';
                      $Division[ViewDivisionStudent::TBL_LEVEL_ID] = '';
                      $Division[ViewDivisionStudent::TBL_DIVISION_NAME] = '';
              Severity: Minor
              Found in Application/People/Person/Frontend/FrontendStudent.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 ($tblYear
                                              && $tblYearItem->getId() != $tblYear->getId()
                                          ) {
                                              continue;
                                          }
              Severity: Major
              Found in Application/Education/Graduation/Evaluation/Frontend.php - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                                        if (isset($grades[$personId][$gradeTypeId]) && $grades[$personId][$gradeTypeId]['Count'] > 0) {
                                                            $studentList[$tblDivision->getId()][$personId]['Type' . $gradeTypeId] =
                                                                new Bold('Ø ' .
                                                                    round(floatval($grades[$personId][$gradeTypeId]['Sum']) / floatval($grades[$personId][$gradeTypeId]['Count']),
                                                                        2) . ' | ') . $studentListByDivision['Type' . $gradeTypeId];
                Severity: Major
                Found in Application/Education/Graduation/Evaluation/Frontend.php - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                                          if ($showProposalBehaviorGrade) {
                                                              $proposalGrade = new Warning(new Bold('f'));
                                                              if (($tblProposalBehaviorGrade = Gradebook::useService()->getProposalBehaviorGrade(
                                                                  $tblDivision, $tblTask, $tblGradeType, $tblPerson
                                                                  )) && $tblProposalBehaviorGrade->getDisplayGrade() !== ''
                  Severity: Major
                  Found in Application/Education/Graduation/Evaluation/Frontend.php - About 45 mins to fix

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

                            $Name,
                            $Code,
                            $Description,
                            $IsHighlighted,
                            TblTestType $tblTestType,
                    Severity: Minor
                    Found in Application/Education/Graduation/Gradebook/Service/Data.php - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                              if ($tblDivisionStudentAll) {
                                                                  foreach ($tblDivisionStudentAll as $tblPerson) {
                                                                      if ($this->checkIsPersonInActive($tblDivision, $tblPerson, $taskDate)) {
                                                                          continue;
                                                                      }
                      Severity: Major
                      Found in Application/Education/Graduation/Evaluation/Frontend.php - About 45 mins to fix

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

                            public function getDateForSorter()
                            {
                        
                                if (($tblTest = $this->getServiceTblTest())) {
                                    if ($tblTest->isContinues()) {
                        Severity: Minor
                        Found in Application/Education/Graduation/Gradebook/Service/Entity/TblGrade.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 ($tblGrade) {
                                                                    if (!$tblTestTemp->isContinues()    // Testdatum
                                                                        || ($tblTestTemp->isContinues()   // Notendatum
                                                                            && $tblGrade->getDate() && $tblTask->getDate()
                                                                            && ($taskDate = new \DateTime($tblTask->getDate()))
                        Severity: Major
                        Found in Application/Education/Graduation/Evaluation/Frontend.php - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                                      if ($posStart !== false) {
                                                                          $average = substr($average, 0, $posStart);
                                                                      }
                          Severity: Major
                          Found in Application/Education/Graduation/Evaluation/Frontend.php - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                                        if ($tblPerson) {
                                                                            if ($this->checkIsPersonInActive($tblDivision, $tblPerson, $taskDate)) {
                                                                                continue;
                                                                            }
                            
                            
                            Severity: Major
                            Found in Application/Education/Graduation/Evaluation/Frontend.php - About 45 mins to fix

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

                                      TblPerson $tblPerson,
                                      TblDivision $tblDivision,
                                      TblSubject $tblSubject,
                                      TblTestType $tblTestType,
                                      TblPeriod $tblPeriod = null,
                              Severity: Minor
                              Found in Application/Education/Graduation/Gradebook/Service/Data.php - About 45 mins to fix

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

                                    public function getGradesByStudent(
                                        TblPerson $tblPerson,
                                        TblDivision $tblDivision,
                                        TblSubject $tblSubject,
                                        TblTestType $tblTestType,
                                Severity: Minor
                                Found in Application/Education/Graduation/Gradebook/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

                                Severity
                                Category
                                Status
                                Source
                                Language