DerDu/SPHERE-Framework

View on GitHub
Application/Api/Document/Creator.php

Summary

Maintainability
F
5 days
Test Coverage

Function createBillingDocumentPdf has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
Open

    public static function createBillingDocumentPdf($Data = array(), $Redirect = true)
    {

        if ($Redirect) {
            return \SPHERE\Application\Api\Education\Certificate\Generator\Creator::displayWaitingPage(
Severity: Minor
Found in Application/Api/Document/Creator.php - About 1 day 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 Creator.php has 528 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
namespace SPHERE\Application\Api\Document;

use MOC\V\Component\Document\Component\Parameter\Repository\PaperOrientationParameter;
use MOC\V\Component\Document\Document as PdfDocument;
Severity: Major
Found in Application/Api/Document/Creator.php - About 1 day to fix

    Method createBillingDocumentPdf has 91 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function createBillingDocumentPdf($Data = array(), $Redirect = true)
        {
    
            if ($Redirect) {
                return \SPHERE\Application\Api\Education\Certificate\Generator\Creator::displayWaitingPage(
    Severity: Major
    Found in Application/Api/Document/Creator.php - About 3 hrs to fix

      Method createBillingDocumentWarningPdf has 63 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function createBillingDocumentWarningPdf($Data = array(), $Redirect = true)
          {
      
              if ($Redirect) {
                  return \SPHERE\Application\Api\Education\Certificate\Generator\Creator::displayWaitingPage(
      Severity: Major
      Found in Application/Api/Document/Creator.php - About 2 hrs to fix

        Function createMultiPdf has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function createMultiPdf(TblPerson $tblPerson, $tblSchoolTypeList, $paperOrientation = 'PORTRAIT')
            {
        
                $Data['Person']['Id'] = $tblPerson->getId();
                $pageList = array();
        Severity: Minor
        Found in Application/Api/Document/Creator.php - About 2 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 createMultiGradebookPdf has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function createMultiGradebookPdf($DivisionId, $Redirect = true)
            {
        
                if ($Redirect) {
                    return \SPHERE\Application\Api\Education\Certificate\Generator\Creator::displayWaitingPage(
        Severity: Minor
        Found in Application/Api/Document/Creator.php - About 1 hr to fix

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

              public static function createMultiGradebookOverviewPdf($DivisionId, $paperOrientation = Creator::PAPERORIENTATION_LANDSCAPE
                  , $Redirect = true)
              {
          
                  // Warteseite
          Severity: Minor
          Found in Application/Api/Document/Creator.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 createBillingDocumentWarningPdf has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function createBillingDocumentWarningPdf($Data = array(), $Redirect = true)
              {
          
                  if ($Redirect) {
                      return \SPHERE\Application\Api\Education\Certificate\Generator\Creator::displayWaitingPage(
          Severity: Minor
          Found in Application/Api/Document/Creator.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 createMultiGradebookPdf has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function createMultiGradebookPdf($DivisionId, $Redirect = true)
              {
          
                  if ($Redirect) {
                      return \SPHERE\Application\Api\Education\Certificate\Generator\Creator::displayWaitingPage(
          Severity: Minor
          Found in Application/Api/Document/Creator.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 createMultiGradebookOverviewPdf has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function createMultiGradebookOverviewPdf($DivisionId, $paperOrientation = Creator::PAPERORIENTATION_LANDSCAPE
                  , $Redirect = true)
              {
          
                  // Warteseite
          Severity: Minor
          Found in Application/Api/Document/Creator.php - About 1 hr to fix

            Method createMultiPasswordPdf has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function createMultiPasswordPdf($Data, $paperOrientation = Creator::PAPERORIENTATION_PORTRAIT)
                {
            
                    $multiPassword = new MultiPassword($Data);
                    $pageList = $multiPassword->getPageList();
            Severity: Minor
            Found in Application/Api/Document/Creator.php - About 1 hr to fix

              Function createDataPdf has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function createDataPdf($Data, $DocumentName, $paperOrientation = Creator::PAPERORIENTATION_PORTRAIT)
                  {
                      if (!empty($Data)
                      ) {
              
              
              Severity: Minor
              Found in Application/Api/Document/Creator.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 createPdf has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function createPdf($PersonId, $DocumentClass, $paperOrientation = Creator::PAPERORIENTATION_PORTRAIT, $Data = array())
                  {
              
                      if (($tblPerson = Person::useService()->getPersonById($PersonId))
                          && class_exists($DocumentClass)
              Severity: Minor
              Found in Application/Api/Document/Creator.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 createMultiPdf has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function createMultiPdf(TblPerson $tblPerson, $tblSchoolTypeList, $paperOrientation = 'PORTRAIT')
                  {
              
                      $Data['Person']['Id'] = $tblPerson->getId();
                      $pageList = array();
              Severity: Minor
              Found in Application/Api/Document/Creator.php - About 1 hr to fix

                Method createGradebookPdf has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function createGradebookPdf($DivisionSubjectId, $Redirect = true)
                    {
                
                        if ($Redirect) {
                            return \SPHERE\Application\Api\Education\Certificate\Generator\Creator::displayWaitingPage(
                Severity: Minor
                Found in Application/Api/Document/Creator.php - About 1 hr to fix

                  Method createKamenzPdf has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function createKamenzPdf($Type = '', $Redirect = true)
                      {
                  
                          if ($Redirect) {
                              return \SPHERE\Application\Api\Education\Certificate\Generator\Creator::displayWaitingPage(
                  Severity: Minor
                  Found in Application/Api/Document/Creator.php - About 1 hr to fix

                    Method createPdf has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public static function createPdf($PersonId, $DocumentClass, $paperOrientation = Creator::PAPERORIENTATION_PORTRAIT, $Data = array())
                        {
                    
                            if (($tblPerson = Person::useService()->getPersonById($PersonId))
                                && class_exists($DocumentClass)
                    Severity: Minor
                    Found in Application/Api/Document/Creator.php - About 1 hr to fix

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

                          public static function createChangePasswordPdf($Data, $paperOrientation = Creator::PAPERORIENTATION_PORTRAIT)
                          {
                              if (!empty($Data)
                              ) {
                      
                      
                      Severity: Minor
                      Found in Application/Api/Document/Creator.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 createMultiPasswordPdf has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static function createMultiPasswordPdf($Data, $paperOrientation = Creator::PAPERORIENTATION_PORTRAIT)
                          {
                      
                              $multiPassword = new MultiPassword($Data);
                              $pageList = $multiPassword->getPageList();
                      Severity: Minor
                      Found in Application/Api/Document/Creator.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 ($isList) {
                                                          $maxPdfPages = Balance::useFrontend()->getMaxPdfPages();
                                                          if ($countPdfs > $maxPdfPages * $list && $countPdfs <= $maxPdfPages * ($list + 1)) {
                                                              // werden hinzugefĆ¼gt
                                                          } else {
                      Severity: Major
                      Found in Application/Api/Document/Creator.php - About 45 mins to fix

                        Method buildDummyFile has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            private static function buildDummyFile($DocumentClass, $Data = array(), $pageList = array(),
                                $paperOrientation = Creator::PAPERORIENTATION_PORTRAIT, $isDestruction = true)
                        Severity: Minor
                        Found in Application/Api/Document/Creator.php - About 35 mins to fix

                          There are no issues that match your filters.

                          Category
                          Status