DerDu/SPHERE-Framework

View on GitHub
Application/Api/Education/Certificate/Generator/Repository/GradeInformation.php

Summary

Maintainability
F
3 days
Test Coverage

Method getGradeLanesForGradeInformation has 143 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function getGradeLanesForGradeInformation(TblPerson $tblPerson = null)
    {

        $personId = $tblPerson ? $tblPerson->getId() : 0;

    Function getSubjectList has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
    Open

        private function getSubjectList(TblPerson $tblPerson = null)
        {
            $subjectList = array();
            $tblCertificateSubjectAll = Generator::useService()->getCertificateSubjectAll($this->getCertificateEntity());
            if ($tblCertificateSubjectAll) {

    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 GradeInformation.php has 356 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * Created by PhpStorm.
     * User: Kauschke
     * Date: 30.09.2016

      Method buildPages has 83 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function buildPages(TblPerson $tblPerson = null){
      
              $personId = $tblPerson ? $tblPerson->getId() : 0;
      
              return (new Page())

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

            protected function getGradeLanesForGradeInformation(TblPerson $tblPerson = null)
            {
        
                $personId = $tblPerson ? $tblPerson->getId() : 0;
        
        

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

            protected function getSubjectLanesForGradeInformation(TblPerson $tblPerson = null)
            {
        
                $personId = $tblPerson ? $tblPerson->getId() : 0;
        
        

          Method getSubjectList has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function getSubjectList(TblPerson $tblPerson = null)
              {
                  $subjectList = array();
                  $tblCertificateSubjectAll = Generator::useService()->getCertificateSubjectAll($this->getCertificateEntity());
                  if ($tblCertificateSubjectAll) {

            Avoid deeply nested control flow statements.
            Open

                                            if (Division::useService()->getSubjectStudentByDivisionSubjectAndPerson(
                                                $tblDivisionSubjectItem, $tblPerson
                                            )
                                            ) {
                                                $subjectList[$tblCertificateSubject->getRanking()] = $tblSubject;

              There are no issues that match your filters.

              Category
              Status