DerDu/SPHERE-Framework

View on GitHub
Application/Api/Document/Custom/Zwickau/Repository/SchoolContract.php

Summary

Maintainability
D
2 days
Test Coverage

Method buildDocument has 250 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function buildDocument($pageList = array())
    {
        return (new Frame())->addDocument((new Document())
            ->addPage((new Page())
                ->addSlice((new Slice())
Severity: Major
Found in Application/Api/Document/Custom/Zwickau/Repository/SchoolContract.php - About 1 day to fix

    File SchoolContract.php has 325 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    namespace SPHERE\Application\Api\Document\Custom\Zwickau\Repository;
    
    use SPHERE\Application\Api\Document\AbstractDocument;
    use SPHERE\Application\Document\Generator\Repository\Document;
    Severity: Minor
    Found in Application/Api/Document/Custom/Zwickau/Repository/SchoolContract.php - About 3 hrs to fix

      Function setFieldValue has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

          private function setFieldValue($DataPost)
          {
      
              //getPerson
              $this->FieldValue['PersonId'] = $PersonId = (isset($DataPost['PersonId']) && $DataPost['PersonId'] != '' ? $DataPost['PersonId'] : false);
      Severity: Minor
      Found in Application/Api/Document/Custom/Zwickau/Repository/SchoolContract.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 setFieldValue has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function setFieldValue($DataPost)
          {
      
              //getPerson
              $this->FieldValue['PersonId'] = $PersonId = (isset($DataPost['PersonId']) && $DataPost['PersonId'] != '' ? $DataPost['PersonId'] : false);

        Avoid deeply nested control flow statements.
        Open

                                if (($tblCommonGender = $tblCommonBirthDates->getTblCommonGender())) {
                                    $this->FieldValue['Gender'] = $tblCommonGender->getName();
                                }
        Severity: Major
        Found in Application/Api/Document/Custom/Zwickau/Repository/SchoolContract.php - About 45 mins to fix

          There are no issues that match your filters.

          Category
          Status