LarsNieuwenhuizen/ClubhouseConnector

View on GitHub
src/Component/Stories/Domain/Model/Story.php

Summary

Maintainability
F
4 days
Test Coverage

Story has 106 functions (exceeds 20 allowed). Consider refactoring.
Open

final class Story implements ComponentResponseBody, UpdateableComponent, CreateableComponent
{

    const STORY_TYPE_CHORE = 'chore';
    const STORY_TYPE_BUG = 'bug';
Severity: Major
Found in src/Component/Stories/Domain/Model/Story.php - About 2 days to fix

    File Story.php has 709 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    declare(strict_types = 1);
    
    namespace LarsNieuwenhuizen\ClubhouseConnector\Component\Stories\Domain\Model;
    
    
    Severity: Major
    Found in src/Component/Stories/Domain/Model/Story.php - About 1 day to fix

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

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

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

            public function toArrayForCreation(): array
            {
                $data = [
                    'archived' => $this->getArchived(),
                    'comments' => $this->getComments(),
        Severity: Minor
        Found in src/Component/Stories/Domain/Model/Story.php - About 1 hr to fix

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

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

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

                public static function createFromResponseData(array $values): Story
                {
                    $object = new static();
                    $object->appUrl = $values['app_url'];
                    $object->archived = $values['archived'];
            Severity: Minor
            Found in src/Component/Stories/Domain/Model/Story.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 toArrayForBulkUpdate has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function toArrayForBulkUpdate()
                {
                    $data = [
                        'archived' => $this->getArchived(),
                        'epic_id' => $this->getEpicId(),
            Severity: Minor
            Found in src/Component/Stories/Domain/Model/Story.php - About 1 hr to fix

              Function toArrayForBulkUpdate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function toArrayForBulkUpdate()
                  {
                      $data = [
                          'archived' => $this->getArchived(),
                          'epic_id' => $this->getEpicId(),
              Severity: Minor
              Found in src/Component/Stories/Domain/Model/Story.php - About 25 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