DerDu/SPHERE-Framework

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

Summary

Maintainability
C
1 day
Test Coverage

TblGrade has 33 functions (exceeds 20 allowed). Consider refactoring.
Open

class TblGrade extends Element
{

    const ATTR_TBL_GRADE_TYPE = 'tblGradeType';
    const ATTR_TBL_GRADE_TEXT = 'tblGradeText';

    File TblGrade.php has 268 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    namespace SPHERE\Application\Education\Graduation\Gradebook\Service\Entity;
    
    use Doctrine\ORM\Mapping\Cache;
    use Doctrine\ORM\Mapping\Column;

      Function getDisplayGrade has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getDisplayGrade($WithTrend = true)
          {
      
              if ($this->getTblGradeText()){
                  return $this->getTblGradeText()->getName();
      Severity: Minor
      Found in Application/Education/Graduation/Gradebook/Service/Entity/TblGrade.php - About 55 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 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

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

          public function getDisplayTeacher()
          {
      
              if (($tblPerson = $this->getServiceTblPersonTeacher())){
                  if (($tblTeacher = Teacher::useService()->getTeacherByPerson($tblPerson))){
      Severity: Minor
      Found in Application/Education/Graduation/Gradebook/Service/Entity/TblGrade.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

      There are no issues that match your filters.

      Category
      Status