DerDu/SPHERE-Framework

View on GitHub
Application/Education/Graduation/Gradebook/Service.php

Summary

Maintainability
F
1 mo
Test Coverage

Function calcStudentGrade has a Cognitive Complexity of 288 (exceeds 5 allowed). Consider refactoring.
Open

    public function calcStudentGrade(
        TblPerson $tblPerson,
        TblDivision $tblDivision,
        TblSubject $tblSubject,
        TblTestType $tblTestType,
Severity: Minor
Found in Application/Education/Graduation/Gradebook/Service.php - About 5 days 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

File Service.php has 1429 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace SPHERE\Application\Education\Graduation\Gradebook;

use SPHERE\Application\Education\Certificate\Generator\Generator;
Severity: Major
Found in Application/Education/Graduation/Gradebook/Service.php - About 3 days to fix

    Function getScoreConditionByStudent has a Cognitive Complexity of 183 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getScoreConditionByStudent(
            TblScoreRule $tblScoreRule,
            $tblGradeList,
            TblYear $tblYear = null,
            TblPeriod $tblPeriod = null,
    Severity: Minor
    Found in Application/Education/Graduation/Gradebook/Service.php - About 3 days 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 updateGradeToTest has a Cognitive Complexity of 126 (exceeds 5 allowed). Consider refactoring.
    Open

        public function updateGradeToTest(
            IFormInterface $Stage = null,
            $TestId = null,
            $Grade = null,
            $BasicRoute,
    Severity: Minor
    Found in Application/Education/Graduation/Gradebook/Service.php - About 2 days 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 calcStudentGrade has 241 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function calcStudentGrade(
            TblPerson $tblPerson,
            TblDivision $tblDivision,
            TblSubject $tblSubject,
            TblTestType $tblTestType,
    Severity: Major
    Found in Application/Education/Graduation/Gradebook/Service.php - About 1 day to fix

      Method updateGradeToTest has 241 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function updateGradeToTest(
              IFormInterface $Stage = null,
              $TestId = null,
              $Grade = null,
              $BasicRoute,
      Severity: Major
      Found in Application/Education/Graduation/Gradebook/Service.php - About 1 day to fix

        Function updateScoreTypeDivisionSubject has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
        Open

            public function updateScoreTypeDivisionSubject(
                IFormInterface $Stage = null,
                TblScoreType $tblScoreType,
                TblYear $tblYear = null,
                $Data = null
        Severity: Minor
        Found in Application/Education/Graduation/Gradebook/Service.php - About 1 day 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 filterDivisionSubjectList has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
        Open

            public function filterDivisionSubjectList(
                $tblDivisionSubjectList,
                TblYear $filterYear = null,
                TblType $filterType = null,
                TblLevel $filterLevel = null
        Severity: Minor
        Found in Application/Education/Graduation/Gradebook/Service.php - About 1 day 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

        Service has 49 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Service extends ServiceScoreRule
        {
        
            /**
             * @param bool $doSimulation
        Severity: Minor
        Found in Application/Education/Graduation/Gradebook/Service.php - About 6 hrs to fix

          Function getAverageByTest has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getAverageByTest(TblTest $tblTest, &$gradeMirror = array())
              {
          
                  $tblDivision = $tblTest->getServiceTblDivision();
                  $tblSubject = $tblTest->getServiceTblSubject();
          Severity: Minor
          Found in Application/Education/Graduation/Gradebook/Service.php - About 6 hrs 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 updateProposalBehaviorGrade has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
          Open

              public function updateProposalBehaviorGrade(
                  IFormInterface $form,
                  TblDivision $tblDivision,
                  TblTask $tblTask,
                  TblGradeType $tblGradeType,
          Severity: Minor
          Found in Application/Education/Graduation/Gradebook/Service.php - About 5 hrs 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 getScoreConditionByStudent has 92 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getScoreConditionByStudent(
                  TblScoreRule $tblScoreRule,
                  $tblGradeList,
                  TblYear $tblYear = null,
                  TblPeriod $tblPeriod = null,
          Severity: Major
          Found in Application/Education/Graduation/Gradebook/Service.php - About 3 hrs to fix

            Function sortGradeList has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
            Open

                public function sortGradeList($tblGradeList)
                {
            
                    if (($tblSetting = Consumer::useService()->getSetting(
                            'Education', 'Graduation', 'Gradebook', 'SortHighlighted'
            Severity: Minor
            Found in Application/Education/Graduation/Gradebook/Service.php - About 3 hrs 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 updateProposalBehaviorGrade has 75 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function updateProposalBehaviorGrade(
                    IFormInterface $form,
                    TblDivision $tblDivision,
                    TblTask $tblTask,
                    TblGradeType $tblGradeType,
            Severity: Major
            Found in Application/Education/Graduation/Gradebook/Service.php - About 3 hrs to fix

              Method filterDivisionSubjectList has 61 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function filterDivisionSubjectList(
                      $tblDivisionSubjectList,
                      TblYear $filterYear = null,
                      TblType $filterType = null,
                      TblLevel $filterLevel = null
              Severity: Major
              Found in Application/Education/Graduation/Gradebook/Service.php - About 2 hrs to fix

                Method updateScoreTypeDivisionSubject has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function updateScoreTypeDivisionSubject(
                        IFormInterface $Stage = null,
                        TblScoreType $tblScoreType,
                        TblYear $tblYear = null,
                        $Data = null
                Severity: Major
                Found in Application/Education/Graduation/Gradebook/Service.php - About 2 hrs to fix

                  Function getGradesAllByStudentAndYearAndSubject has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getGradesAllByStudentAndYearAndSubject(
                          TblPerson $tblPerson,
                          TblYear $tblYear,
                          TblSubject $tblSubject,
                          TblTestType $tblTestType,
                  Severity: Minor
                  Found in Application/Education/Graduation/Gradebook/Service.php - About 2 hrs 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 getGradesFromAnotherDivisionByStudent has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getGradesFromAnotherDivisionByStudent(
                          TblDivision $tblDivision,
                          TblSubject $tblSubject,
                          TblYear $tblYear,
                          TblPerson $tblPerson,
                  Severity: Minor
                  Found in Application/Education/Graduation/Gradebook/Service.php - About 2 hrs 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 sortGradeList has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function sortGradeList($tblGradeList)
                      {
                  
                          if (($tblSetting = Consumer::useService()->getSetting(
                                  'Education', 'Graduation', 'Gradebook', 'SortHighlighted'
                  Severity: Minor
                  Found in Application/Education/Graduation/Gradebook/Service.php - About 1 hr to fix

                    Method getAverageByTest has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function getAverageByTest(TblTest $tblTest, &$gradeMirror = array())
                        {
                    
                            $tblDivision = $tblTest->getServiceTblDivision();
                            $tblSubject = $tblTest->getServiceTblSubject();
                    Severity: Minor
                    Found in Application/Education/Graduation/Gradebook/Service.php - About 1 hr to fix

                      Method setDisableParent has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function setDisableParent(
                              IFormInterface $Form,
                              $ParentAccount,
                              $tblAccountStudent
                          ) {
                      Severity: Minor
                      Found in Application/Education/Graduation/Gradebook/Service.php - About 1 hr to fix

                        Method updateGradeType has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function updateGradeType(IFormInterface $Stage = null, $Id, $GradeType)
                            {
                        
                                /**
                                 * Skip to Frontend
                        Severity: Minor
                        Found in Application/Education/Graduation/Gradebook/Service.php - About 1 hr to fix

                          Method calcStudentGrade has 10 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  TblPerson $tblPerson,
                                  TblDivision $tblDivision,
                                  TblSubject $tblSubject,
                                  TblTestType $tblTestType,
                                  TblScoreRule $tblScoreRule = null,
                          Severity: Major
                          Found in Application/Education/Graduation/Gradebook/Service.php - About 1 hr to fix

                            Method createGradeType has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function createGradeType(IFormInterface $Stage = null, $GradeType)
                                {
                            
                                    /**
                                     * Skip to Frontend
                            Severity: Minor
                            Found in Application/Education/Graduation/Gradebook/Service.php - About 1 hr to fix

                              Method getGradesFromAnotherDivisionByStudent has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function getGradesFromAnotherDivisionByStudent(
                                      TblDivision $tblDivision,
                                      TblSubject $tblSubject,
                                      TblYear $tblYear,
                                      TblPerson $tblPerson,
                              Severity: Minor
                              Found in Application/Education/Graduation/Gradebook/Service.php - About 1 hr to fix

                                Function setDisableParent has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function setDisableParent(
                                        IFormInterface $Form,
                                        $ParentAccount,
                                        $tblAccountStudent
                                    ) {
                                Severity: Minor
                                Found in Application/Education/Graduation/Gradebook/Service.php - About 1 hr 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

                                Consider simplifying this complex logical expression.
                                Open

                                                if ($tblDivisionStudentItem->getLeaveDateTime() !== null
                                                    && $tblDivisionStudentItem->getUseGradesInNewDivision()
                                                    && ($tblDivisionItem = $tblDivisionStudentItem->getTblDivision())
                                                    && $tblDivision->getId() != $tblDivisionItem->getId()
                                                    && ($tblYearItem = $tblDivisionItem->getServiceTblYear())
                                Severity: Major
                                Found in Application/Education/Graduation/Gradebook/Service.php - About 1 hr to fix

                                  Method isEditGrade has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      private function isEditGrade(TblGrade $tblGrade, $Comment, $grade, $trend, $date, $text, $publicComment)
                                  Severity: Major
                                  Found in Application/Education/Graduation/Gradebook/Service.php - About 50 mins to fix

                                    Method updateGradeToTest has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                            IFormInterface $Stage = null,
                                            $TestId = null,
                                            $Grade = null,
                                            $BasicRoute,
                                            TblScoreType $tblScoreType = null,
                                    Severity: Major
                                    Found in Application/Education/Graduation/Gradebook/Service.php - About 50 mins to fix

                                      Method updateProposalBehaviorGrade has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                              IFormInterface $form,
                                              TblDivision $tblDivision,
                                              TblTask $tblTask,
                                              TblGradeType $tblGradeType,
                                              $Grade,
                                      Severity: Major
                                      Found in Application/Education/Graduation/Gradebook/Service.php - About 50 mins to fix

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

                                                TblDivision $tblDivision,
                                                TblSubject $tblSubject,
                                                TblYear $tblYear,
                                                TblPerson $tblPerson,
                                                TblTestType $tblTestType,
                                        Severity: Minor
                                        Found in Application/Education/Graduation/Gradebook/Service.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.php - About 45 mins to fix

                                            Avoid deeply nested control flow statements.
                                            Open

                                                                            if (($tblGrade = $this->getGradeById($gradeId))) {
                                                                                $tblGradeList[] = $tblGrade;
                                                                            }
                                            Severity: Major
                                            Found in Application/Education/Graduation/Gradebook/Service.php - About 45 mins to fix

                                              Avoid deeply nested control flow statements.
                                              Open

                                                                                  if (($tblScoreGroup = $tblScoreConditionGroupRequirement->getTblScoreGroup())
                                                                                      && ($tblGradeTypeList = Gradebook::useService()->getScoreGroupGradeTypeListByGroup($tblScoreGroup))
                                                                                  ) {
                                                                                      $gradeTypeList = array();
                                                                                      foreach ($tblGradeTypeList as $tblGradeTypeItem) {
                                              Severity: Major
                                              Found in Application/Education/Graduation/Gradebook/Service.php - About 45 mins to fix

                                                Avoid deeply nested control flow statements.
                                                Open

                                                                                        if ($tblGrade->getGrade() !== null && $tblGrade->getGrade() !== '' && is_numeric($tblGrade->getGrade())) {
                                                                                            // für Teilnoten Extra-Liste
                                                                                            if (($tblGradeType = $tblGrade->getTblGradeType())
                                                                                                && $tblGradeType->isPartGrade()
                                                                                            ) {
                                                Severity: Major
                                                Found in Application/Education/Graduation/Gradebook/Service.php - About 45 mins to fix

                                                  Avoid deeply nested control flow statements.
                                                  Open

                                                                                  if (($tblPeriodList = Term::useService()->getPeriodAllByYear($tblYear, $isLevel12))) {
                                                                                      $firstPeriod = reset($tblPeriodList);
                                                                                      if ($period == TblScoreCondition::PERIOD_FIRST_PERIOD) {
                                                                                          if ($tblPeriod && $firstPeriod->getId() == $tblPeriod->getId()) {
                                                  
                                                  
                                                  Severity: Major
                                                  Found in Application/Education/Graduation/Gradebook/Service.php - About 45 mins to fix

                                                    Avoid deeply nested control flow statements.
                                                    Open

                                                                                    if (isset($group['Value']) && isset($group['Multiplier'])) {
                                                                                        $totalMultiplier += $multiplier;
                                                                                        $average += $multiplier * ($group['Value'] / $group['Multiplier']);
                                                                                    }
                                                    Severity: Major
                                                    Found in Application/Education/Graduation/Gradebook/Service.php - About 45 mins to fix

                                                      Avoid deeply nested control flow statements.
                                                      Open

                                                                                          if (($tblGradeType = $tblScoreConditionGradeTypeList->getTblGradeType())) {
                                                                                              /** @var TblGrade $tblGrade */
                                                                                              foreach ($tblGradeList as $tblGrade) {
                                                                                                  if (is_numeric($tblGrade->getGrade())
                                                                                                      && $tblGrade->getTblGradeType()
                                                      Severity: Major
                                                      Found in Application/Education/Graduation/Gradebook/Service.php - About 45 mins to fix

                                                        Avoid deeply nested control flow statements.
                                                        Open

                                                                                    if ($hasMirror) {
                                                                                        $value = intval(round($value, 0));
                                                                                        $gradeMirror[$value]++;
                                                                                    }
                                                        Severity: Major
                                                        Found in Application/Education/Graduation/Gradebook/Service.php - About 45 mins to fix

                                                          Avoid deeply nested control flow statements.
                                                          Open

                                                                                              if (isset($itemValue['Value']) && isset($itemValue['Multiplier'])) {
                                                                                                  $totalMultiplier += $multiplier;
                                                                                                  $average += $multiplier * ($itemValue['Value'] / $itemValue['Multiplier']);
                                                                                              }
                                                          Severity: Major
                                                          Found in Application/Education/Graduation/Gradebook/Service.php - About 45 mins to fix

                                                            Avoid deeply nested control flow statements.
                                                            Open

                                                                                        if (($tblTask = $tblTest->getTblTask()) && !$tblTask->isLocked()) {
                                                                                            Evaluation::useService()->setTaskLocked($tblTask);
                                                                                        }
                                                            Severity: Major
                                                            Found in Application/Education/Graduation/Gradebook/Service.php - About 45 mins to fix

                                                              Consider simplifying this complex logical expression.
                                                              Open

                                                                              if ($filterYear && $filterLevel && $filterType) {
                                                                                  if ($hasYear && $hasLevel && $hasType) {
                                                                                      array_push($resultList, $tblDivisionSubject);
                                                                                  }
                                                                              } elseif ($filterYear && $filterLevel) {
                                                              Severity: Major
                                                              Found in Application/Education/Graduation/Gradebook/Service.php - About 40 mins to fix

                                                                Consider simplifying this complex logical expression.
                                                                Open

                                                                                        if ($tblGradeItem && $gradeValue === ''
                                                                                            && !isset($value['Attendance'])
                                                                                            && (!isset($value['Text']) || (isset($value['Text']) && !$this->getGradeTextById($value['Text'])))
                                                                                        ) {
                                                                                            $errorNoGrade[] = new Container(new Bold($tblPerson->getLastFirstName()));
                                                                Severity: Major
                                                                Found in Application/Education/Graduation/Gradebook/Service.php - About 40 mins to fix

                                                                  Method getScoreConditionByStudent has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                  Open

                                                                          TblScoreRule $tblScoreRule,
                                                                          $tblGradeList,
                                                                          TblYear $tblYear = null,
                                                                          TblPeriod $tblPeriod = null,
                                                                          $isLevel12 = false
                                                                  Severity: Minor
                                                                  Found in Application/Education/Graduation/Gradebook/Service.php - About 35 mins to fix

                                                                    Method getGradesAllByStudentAndYearAndSubject has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                    Open

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

                                                                      Function updateGradeType has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                      Open

                                                                          public function updateGradeType(IFormInterface $Stage = null, $Id, $GradeType)
                                                                          {
                                                                      
                                                                              /**
                                                                               * Skip to Frontend
                                                                      Severity: Minor
                                                                      Found in Application/Education/Graduation/Gradebook/Service.php - About 35 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 too many return statements within this method.
                                                                      Open

                                                                              return false;
                                                                      Severity: Major
                                                                      Found in Application/Education/Graduation/Gradebook/Service.php - About 30 mins to fix

                                                                        Avoid too many return statements within this method.
                                                                        Open

                                                                                return false;
                                                                        Severity: Major
                                                                        Found in Application/Education/Graduation/Gradebook/Service.php - About 30 mins to fix

                                                                          Function createGradeType has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                          Open

                                                                              public function createGradeType(IFormInterface $Stage = null, $GradeType)
                                                                              {
                                                                          
                                                                                  /**
                                                                                   * Skip to Frontend
                                                                          Severity: Minor
                                                                          Found in Application/Education/Graduation/Gradebook/Service.php - About 25 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 isEditGrade has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                          Open

                                                                              private function isEditGrade(TblGrade $tblGrade, $Comment, $grade, $trend, $date, $text, $publicComment)
                                                                              {
                                                                                  $isChange = false;
                                                                                  if($tblGrade->getComment() != $Comment){
                                                                                      $isChange = true;
                                                                          Severity: Minor
                                                                          Found in Application/Education/Graduation/Gradebook/Service.php - About 25 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

                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                          Open

                                                                                  if (!empty($Grade)
                                                                                      && $tblScoreType
                                                                                      && $tblScoreType->getPattern() !== ''
                                                                                  ) {
                                                                                      foreach ($Grade as $personId => $value) {
                                                                          Severity: Major
                                                                          Found in Application/Education/Graduation/Gradebook/Service.php and 1 other location - About 4 hrs to fix
                                                                          Application/Education/Graduation/Gradebook/Service.php on lines 1940..1955

                                                                          Duplicated Code

                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                          Tuning

                                                                          This issue has a mass of 168.

                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                          Refactorings

                                                                          Further Reading

                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                          Open

                                                                                  if (!empty($Grade)
                                                                                      && $tblScoreType
                                                                                      && $tblScoreType->getPattern() !== ''
                                                                                  ) {
                                                                                      foreach ($Grade as $personId => $value) {
                                                                          Severity: Major
                                                                          Found in Application/Education/Graduation/Gradebook/Service.php and 1 other location - About 4 hrs to fix
                                                                          Application/Education/Graduation/Gradebook/Service.php on lines 398..413

                                                                          Duplicated Code

                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                          Tuning

                                                                          This issue has a mass of 168.

                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                          Refactorings

                                                                          Further Reading

                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                          Open

                                                                                  if (is_array($Data)) {
                                                                                      foreach ($Data as $divisionId => $subjectList) {
                                                                                          $tblDivision = Division::useService()->getDivisionById($divisionId);
                                                                                          if ($tblDivision) {
                                                                                              if (is_array($subjectList)) {
                                                                          Severity: Major
                                                                          Found in Application/Education/Graduation/Gradebook/Service.php and 1 other location - About 3 hrs to fix
                                                                          Application/Education/Graduation/Gradebook/ScoreRule/Service.php on lines 786..810

                                                                          Duplicated Code

                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                          Tuning

                                                                          This issue has a mass of 158.

                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                          Refactorings

                                                                          Further Reading

                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                          Open

                                                                                          if ($grade != -1) {
                                                                                              if (isset($value['Trend'])) {
                                                                                                  $trend = $value['Trend'];
                                                                                              } elseif ((strpos($grade, '+') !== false)) {
                                                                                                  $trend = TblGrade::VALUE_TREND_PLUS;
                                                                          Severity: Major
                                                                          Found in Application/Education/Graduation/Gradebook/Service.php and 1 other location - About 2 hrs to fix
                                                                          Application/Education/Graduation/Gradebook/Service.php on lines 523..533

                                                                          Duplicated Code

                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                          Tuning

                                                                          This issue has a mass of 135.

                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                          Refactorings

                                                                          Further Reading

                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                          Open

                                                                                              if ($grade != -1) {
                                                                                                  if (isset($value['Trend'])) {
                                                                                                      $trend = $value['Trend'];
                                                                                                  } elseif ((strpos($grade, '+') !== false)) {
                                                                                                      $trend = TblGrade::VALUE_TREND_PLUS;
                                                                          Severity: Major
                                                                          Found in Application/Education/Graduation/Gradebook/Service.php and 1 other location - About 2 hrs to fix
                                                                          Application/Education/Graduation/Gradebook/Service.php on lines 1974..1984

                                                                          Duplicated Code

                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                          Tuning

                                                                          This issue has a mass of 135.

                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                          Refactorings

                                                                          Further Reading

                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                          Open

                                                                              public function getGradesByStudent(
                                                                                  TblPerson $tblPerson,
                                                                                  TblDivision $tblDivision,
                                                                                  TblSubject $tblSubject,
                                                                                  TblTestType $tblTestType,
                                                                          Severity: Minor
                                                                          Found in Application/Education/Graduation/Gradebook/Service.php and 2 other locations - About 30 mins to fix
                                                                          Application/People/Meta/Student/Service.php on lines 1153..1169
                                                                          Application/People/Meta/Student/Service/Service/Subject.php on lines 31..42

                                                                          Duplicated Code

                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                          Tuning

                                                                          This issue has a mass of 90.

                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                          Refactorings

                                                                          Further Reading

                                                                          There are no issues that match your filters.

                                                                          Category
                                                                          Status