DerDu/SPHERE-Framework

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

Summary

Maintainability
D
2 days
Test Coverage

Function getMinimumGradeCountNumber has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
Open

    public function getMinimumGradeCountNumber(
        TblDivisionSubject $tblDivisionSubject,
        TblPerson $tblPerson,
        TblMinimumGradeCount $tblMinimumGradeCount
    ) {

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 getMinimumGradeCountAllByDivisionSubject has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public function getMinimumGradeCountAllByDivisionSubject(
        TblDivisionSubject $tblDivisionSubject,
        $isSekII
    ) {

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 getMinimumGradeCountNumber has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getMinimumGradeCountNumber(
        TblDivisionSubject $tblDivisionSubject,
        TblPerson $tblPerson,
        TblMinimumGradeCount $tblMinimumGradeCount
    ) {

    Method updateMinimumGradeCount has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function updateMinimumGradeCount(IFormInterface $form = null, $MinimumGradeCount, TblMinimumGradeCount $tblMinimumGradeCount = null)
        {
    
            /**
             * Skip to Frontend

      Function updateMinimumGradeCount has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          public function updateMinimumGradeCount(IFormInterface $form = null, $MinimumGradeCount, TblMinimumGradeCount $tblMinimumGradeCount = null)
          {
      
              /**
               * Skip to Frontend

      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 createMinimumGradeCount has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              $Count,
              TblLevel $tblLevel,
              TblSubject $tblSubject = null,
              TblGradeType $tblGradeType = null,
              $Period,
      Severity: Major
      Found in Application/Education/Graduation/Gradebook/MinimumGradeCount/Service.php - About 50 mins to fix

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

                $highlighted,
                TblGradeType $tblGradeType = null,
                $period,
                $course,
                $count
        Severity: Minor
        Found in Application/Education/Graduation/Gradebook/MinimumGradeCount/Service.php - About 35 mins to fix

          There are no issues that match your filters.

          Category
          Status