DerDu/SPHERE-Framework

View on GitHub
Application/Transfer/Indiware/Export/AppointmentGrade/Frontend.php

Summary

Maintainability
D
2 days
Test Coverage

Method frontendExport has 128 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function frontendExport()
    {

        $Stage = new Stage('Export', 'Stichtagsnoten eines Halbjahres');

Severity: Major
Found in Application/Transfer/Indiware/Export/AppointmentGrade/Frontend.php - About 5 hrs to fix

    File Frontend.php has 351 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace SPHERE\Application\Transfer\Indiware\Export\AppointmentGrade;
    
    use SPHERE\Application\Api\Transfer\Indiware\AppointmentGrade\ApiAppointmentGrade;
    Severity: Minor
    Found in Application/Transfer/Indiware/Export/AppointmentGrade/Frontend.php - About 4 hrs to fix

      Method frontendAppointmentGradeUpload has 86 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function frontendAppointmentGradeUpload(
              UploadedFile $File = null,
              $Period = null,
              $TaskId = null
          ) {
      Severity: Major
      Found in Application/Transfer/Indiware/Export/AppointmentGrade/Frontend.php - About 3 hrs to fix

        Function frontendAppointmentGradeUpload has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
        Open

            public function frontendAppointmentGradeUpload(
                UploadedFile $File = null,
                $Period = null,
                $TaskId = null
            ) {
        Severity: Minor
        Found in Application/Transfer/Indiware/Export/AppointmentGrade/Frontend.php - About 3 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 frontendAppointmentGradePrepare has 69 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function frontendAppointmentGradePrepare()
            {
                $Stage = new Stage('Indiware', 'Datentransfer');
                $Stage->addButton(new Standard('Zurück', '/Transfer/Indiware/Export', new ChevronLeft()));
                $Stage->setMessage('Exportvorbereitung / Daten exportieren');
        Severity: Major
        Found in Application/Transfer/Indiware/Export/AppointmentGrade/Frontend.php - About 2 hrs to fix

          Function frontendExport has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

              public function frontendExport()
              {
          
                  $Stage = new Stage('Export', 'Stichtagsnoten eines Halbjahres');
          
          
          Severity: Minor
          Found in Application/Transfer/Indiware/Export/AppointmentGrade/Frontend.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

          Avoid too many return statements within this method.
          Open

                  return $Stage->setContent(new SuccessMessage('Reihenfolge erfolgreich aufgenommen. Weiterleitung erfolgt.'))
                      .new Redirect('/Transfer/Indiware/Export/AppointmentGrade', Redirect::TIMEOUT_SUCCESS);
          Severity: Major
          Found in Application/Transfer/Indiware/Export/AppointmentGrade/Frontend.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return $Stage->setContent(new WarningMessage('Ungültige Dateiendung!'))
                            .new Redirect('/Transfer/Indiware/Export/AppointmentGrade/Prepare', Redirect::TIMEOUT_ERROR);
            Severity: Major
            Found in Application/Transfer/Indiware/Export/AppointmentGrade/Frontend.php - About 30 mins to fix

              There are no issues that match your filters.

              Category
              Status