DerDu/SPHERE-Framework

View on GitHub
Application/Education/Certificate/Prepare/Abitur/LevelTen.php

Summary

Maintainability
D
2 days
Test Coverage

Function __construct has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct(
        TblDivision $tblDivision,
        TblPerson $tblPerson,
        TblPrepareCertificate $tblPrepareCertificate
    ) {
Severity: Minor
Found in Application/Education/Certificate/Prepare/Abitur/LevelTen.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 getContent has 84 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getContent($Data, $GroupId)
    {

        if (($tblPrepareAdditionalGradeType = Prepare::useService()->getPrepareAdditionalGradeTypeByIdentifier('LEVEL-10'))
            && ($tblPrepareAdditionalGradeList = Prepare::useService()->getPrepareAdditionalGradeListBy(
Severity: Major
Found in Application/Education/Certificate/Prepare/Abitur/LevelTen.php - About 3 hrs to fix

    File LevelTen.php has 290 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * Created by PhpStorm.
     * User: Kauschke
     * Date: 16.03.2018
    Severity: Minor
    Found in Application/Education/Certificate/Prepare/Abitur/LevelTen.php - About 2 hrs to fix

      Method __construct has 70 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function __construct(
              TblDivision $tblDivision,
              TblPerson $tblPerson,
              TblPrepareCertificate $tblPrepareCertificate
          ) {
      Severity: Major
      Found in Application/Education/Certificate/Prepare/Abitur/LevelTen.php - About 2 hrs to fix

        Function setData has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

            private function setData()
            {
                $dataList = array();
                if (($tblPrepareAdditionalGradeType = Prepare::useService()->getPrepareAdditionalGradeTypeByIdentifier('LEVEL-10'))) {
                    foreach ($this->availableSubjectList as $tblSubject) {
        Severity: Minor
        Found in Application/Education/Certificate/Prepare/Abitur/LevelTen.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

        Function setAvailableSubjects has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

            private function setAvailableSubjects()
            {
                $this->setCourses();
                $list = array();
                foreach ($this->subjectList as $acronym => $name) {
        Severity: Minor
        Found in Application/Education/Certificate/Prepare/Abitur/LevelTen.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

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

            private function setData()
            {
                $dataList = array();
                if (($tblPrepareAdditionalGradeType = Prepare::useService()->getPrepareAdditionalGradeTypeByIdentifier('LEVEL-10'))) {
                    foreach ($this->availableSubjectList as $tblSubject) {
        Severity: Minor
        Found in Application/Education/Certificate/Prepare/Abitur/LevelTen.php - About 1 hr to fix

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

              private function setAvailableSubjects()
              {
                  $this->setCourses();
                  $list = array();
                  foreach ($this->subjectList as $acronym => $name) {
          Severity: Minor
          Found in Application/Education/Certificate/Prepare/Abitur/LevelTen.php - About 1 hr to fix

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

                public function getContent($Data, $GroupId)
                {
            
                    if (($tblPrepareAdditionalGradeType = Prepare::useService()->getPrepareAdditionalGradeTypeByIdentifier('LEVEL-10'))
                        && ($tblPrepareAdditionalGradeList = Prepare::useService()->getPrepareAdditionalGradeListBy(
            Severity: Minor
            Found in Application/Education/Certificate/Prepare/Abitur/LevelTen.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 ($tblPrepare->getServiceTblGenerateCertificate()
                                        && ($tblCertificateType = $tblPrepare->getServiceTblGenerateCertificate()->getServiceTblCertificateType())
                                        && ($tblCertificateType->getIdentifier() == 'YEAR')
                                        && ($tblPrepareStudent = Prepare::useService()->getPrepareStudentBy($tblPrepare,
                                            $this->tblPerson))
            Severity: Major
            Found in Application/Education/Certificate/Prepare/Abitur/LevelTen.php - About 40 mins to fix

              Consider simplifying this complex logical expression.
              Open

                      if ($tblPrepareStudentLevelTen
                          && $tblPrepareStudentLevelTen->getTblPrepareCertificate()
                          && $tblPrepareStudentLevelTen->getServiceTblPerson()
                          && $tblPrepareStudentLevelTen->getTblPrepareCertificate()->getServiceTblDivision()
                          && ($tblTestType = Evaluation::useService()->getTestTypeByIdentifier('APPOINTED_DATE_TASK'))
              Severity: Major
              Found in Application/Education/Certificate/Prepare/Abitur/LevelTen.php - About 40 mins to fix

                There are no issues that match your filters.

                Category
                Status