LarsNieuwenhuizen/ClubhouseConnector

View on GitHub
src/Component/Epics/Domain/Model/Epic.php

Summary

Maintainability
D
2 days
Test Coverage

Epic has 56 functions (exceeds 20 allowed). Consider refactoring.
Open

final class Epic implements ComponentResponseBody, CreateableComponent, UpdateableComponent
{

    private string $appUrl;
    private bool $archived = false;
Severity: Major
Found in src/Component/Epics/Domain/Model/Epic.php - About 1 day to fix

    File Epic.php has 441 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    declare(strict_types = 1);
    
    namespace LarsNieuwenhuizen\ClubhouseConnector\Component\Epics\Domain\Model;
    
    
    Severity: Minor
    Found in src/Component/Epics/Domain/Model/Epic.php - About 6 hrs to fix

      Method createFromResponseData has 79 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function createFromResponseData(array $values): Epic
          {
              $object = new static();
              $object->appUrl = $values['app_url'];
              $object->archived = $values['archived'];
      Severity: Major
      Found in src/Component/Epics/Domain/Model/Epic.php - About 3 hrs to fix

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

            public function toArrayForUpdate(): array
            {
                $data = [
                    'name' => $this->getName(),
                    'archived' => $this->getArchived(),
        Severity: Minor
        Found in src/Component/Epics/Domain/Model/Epic.php - About 1 hr to fix

          Method toArrayForCreation has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function toArrayForCreation(): array
              {
                  $data = [
                      'name' => $this->getName(),
                      'deadline' => null,
          Severity: Minor
          Found in src/Component/Epics/Domain/Model/Epic.php - About 1 hr to fix

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

                public function toArrayForUpdate(): array
                {
                    $data = [
                        'name' => $this->getName(),
                        'archived' => $this->getArchived(),
            Severity: Minor
            Found in src/Component/Epics/Domain/Model/Epic.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 createFromResponseData has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function createFromResponseData(array $values): Epic
                {
                    $object = new static();
                    $object->appUrl = $values['app_url'];
                    $object->archived = $values['archived'];
            Severity: Minor
            Found in src/Component/Epics/Domain/Model/Epic.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 toArrayForCreation has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                public function toArrayForCreation(): array
                {
                    $data = [
                        'name' => $this->getName(),
                        'deadline' => null,
            Severity: Minor
            Found in src/Component/Epics/Domain/Model/Epic.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

            There are no issues that match your filters.

            Category
            Status