DerDu/SPHERE-Framework

View on GitHub
Application/Education/Certificate/Generate/Service.php

Summary

Maintainability
F
1 wk
Test Coverage

Function createPrepareCertificates has a Cognitive Complexity of 170 (exceeds 5 allowed). Consider refactoring.
Open

    public function createPrepareCertificates(
        IFormInterface $Form = null,
        TblGenerateCertificate $tblGenerateCertificate,
        $Data = null
    ) {
Severity: Minor
Found in Application/Education/Certificate/Generate/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

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

<?php
/**
 * Created by PhpStorm.
 * User: Kauschke
 * Date: 25.11.2016
Severity: Major
Found in Application/Education/Certificate/Generate/Service.php - About 1 day to fix

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

        public function getPossibleCertificates(
            TblPrepareCertificate $tblPrepare,
            TblPerson $tblPerson,
            TblConsumer $tblConsumer = null
        ) {
    Severity: Minor
    Found in Application/Education/Certificate/Generate/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 setCertificateTemplates has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
    Open

        public function setCertificateTemplates(
            TblPrepareCertificate $tblPrepare,
            &$countStudents = 0,
            &$certificateNameList = array(),
            &$schoolNameList = array()
    Severity: Minor
    Found in Application/Education/Certificate/Generate/Service.php - About 4 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 createPrepareCertificates has 103 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function createPrepareCertificates(
            IFormInterface $Form = null,
            TblGenerateCertificate $tblGenerateCertificate,
            $Data = null
        ) {
    Severity: Major
    Found in Application/Education/Certificate/Generate/Service.php - About 4 hrs to fix

      Method updateGenerateCertificate has 60 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function updateGenerateCertificate(
              IFormInterface $Form = null,
              TblGenerateCertificate $tblGenerateCertificate,
              $Data = null
          ) {
      Severity: Major
      Found in Application/Education/Certificate/Generate/Service.php - About 2 hrs to fix

        Method getPossibleCertificates has 53 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getPossibleCertificates(
                TblPrepareCertificate $tblPrepare,
                TblPerson $tblPerson,
                TblConsumer $tblConsumer = null
            ) {
        Severity: Major
        Found in Application/Education/Certificate/Generate/Service.php - About 2 hrs to fix

          Method createGenerateCertificate has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function createGenerateCertificate(IFormInterface $Form = null, $Data = null)
              {
          
                  /**
                   * Skip to Frontend
          Severity: Minor
          Found in Application/Education/Certificate/Generate/Service.php - About 1 hr to fix

            Method updateAbiturSettings has 46 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function updateAbiturSettings(
                    IFormInterface $form,
                    TblGenerateCertificate $tblGenerateCertificate,
                    $Data
                ) {
            Severity: Minor
            Found in Application/Education/Certificate/Generate/Service.php - About 1 hr to fix

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

                  public function updateGenerateCertificate(
                      IFormInterface $Form = null,
                      TblGenerateCertificate $tblGenerateCertificate,
                      $Data = null
                  ) {
              Severity: Minor
              Found in Application/Education/Certificate/Generate/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

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

                  public function setCertificateTemplates(
                      TblPrepareCertificate $tblPrepare,
                      &$countStudents = 0,
                      &$certificateNameList = array(),
                      &$schoolNameList = array()
              Severity: Minor
              Found in Application/Education/Certificate/Generate/Service.php - About 1 hr to fix

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

                    private function checkAutoSelect(TblPerson $tblPerson, TblType $tblType)
                    {
                
                        if ($tblType->getName() == 'Mittelschule / Oberschule') {
                            if (($tblSupport = Student::useService()->getSupportForReportingByPerson($tblPerson))
                Severity: Minor
                Found in Application/Education/Certificate/Generate/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

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

                    public function createGenerateCertificate(IFormInterface $Form = null, $Data = null)
                    {
                
                        /**
                         * Skip to Frontend
                Severity: Minor
                Found in Application/Education/Certificate/Generate/Service.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

                Avoid deeply nested control flow statements.
                Open

                                        if ($tblStudentTransfer) {
                                            $tblCourse = $tblStudentTransfer->getServiceTblCourse();
                                        }
                Severity: Major
                Found in Application/Education/Certificate/Generate/Service.php - About 45 mins to fix

                  Function editCertificateTemplates has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function editCertificateTemplates(
                          IFormInterface $Form = null,
                          TblPrepareCertificate $tblPrepare,
                          $Data = null
                      ) {
                  Severity: Minor
                  Found in Application/Education/Certificate/Generate/Service.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

                  Avoid deeply nested control flow statements.
                  Open

                                                  if ($tblType && !$this->checkAutoSelect($tblPerson, $tblType)) {
                                                      continue;
                                                  }
                  Severity: Major
                  Found in Application/Education/Certificate/Generate/Service.php - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                    if (($tblPrepareStudent = Prepare::useService()->getPrepareStudentBy($tblPrepare,
                                                        $tblPerson))
                                                    ) {
                                                        if (($tblCertificate = $tblPrepareStudent->getServiceTblCertificate())) {
                                                            continue;
                    Severity: Major
                    Found in Application/Education/Certificate/Generate/Service.php - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                      if ($tblConsumerBySession) {
                                                          // Eigene Vorlage
                                                          if (($certificateList = $this->getPossibleCertificates($tblPrepare, $tblPerson,
                                                              $tblConsumerBySession))
                                                          ) {
                      Severity: Major
                      Found in Application/Education/Certificate/Generate/Service.php - About 45 mins to fix

                        Consider simplifying this complex logical expression.
                        Open

                                if (($tblDivision = $tblPrepare->getServiceTblDivision())
                                    && ($tblLevel = $tblDivision->getTblLevel())
                                    && ($tblSchoolType = $tblLevel->getServiceTblType())
                                    && $tblPrepare->getServiceTblGenerateCertificate()
                                    && ($tblCertificateType = $tblPrepare->getServiceTblGenerateCertificate()->getServiceTblCertificateType())
                        Severity: Major
                        Found in Application/Education/Certificate/Generate/Service.php - About 40 mins to fix

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

                              public function updateAbiturSettings(
                                  IFormInterface $form,
                                  TblGenerateCertificate $tblGenerateCertificate,
                                  $Data
                              ) {
                          Severity: Minor
                          Found in Application/Education/Certificate/Generate/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

                          There are no issues that match your filters.

                          Category
                          Status