LarsNieuwenhuizen/ClubhouseConnector

View on GitHub

Showing 24 of 24 total issues

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

      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

          Milestone has 42 functions (exceeds 20 allowed). Consider refactoring.
          Open

          final class Milestone implements ComponentResponseBody, UpdateableComponent, CreateableComponent
          {
          
              private string $appUrl;
              private array $categories = [];
          Severity: Minor
          Found in src/Component/Milestones/Domain/Model/Milestone.php - About 5 hrs to fix

            Project has 41 functions (exceeds 20 allowed). Consider refactoring.
            Open

            final class Project implements ComponentResponseBody, UpdateableComponent, CreateableComponent
            {
            
                private int $id;
            
            
            Severity: Minor
            Found in src/Component/Projects/Domain/Model/Project.php - About 5 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

                File Milestone.php has 297 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                declare(strict_types = 1);
                
                namespace LarsNieuwenhuizen\ClubhouseConnector\Component\Milestones\Domain\Model;
                
                
                Severity: Minor
                Found in src/Component/Milestones/Domain/Model/Milestone.php - About 3 hrs 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

                    File Project.php has 274 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

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

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

                          public static function createFromResponseData(array $values): Milestone
                          {
                              $object = new static();
                              $object->appUrl = $values['app_url'];
                              $object->categories = $values['categories'] ?? [];
                      Severity: Major
                      Found in src/Component/Milestones/Domain/Model/Milestone.php - About 2 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

                            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

                                Method update has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function update(UpdateableComponent $component): ComponentResponseBody
                                    {
                                        if (!$component instanceof $this->componentClass) {
                                            $message = 'The object you are trying to update of type ' .
                                                \get_class($component) . ' is not a ' . $this->componentName;
                                Severity: Minor
                                Found in src/Component/AbstractComponentService.php - About 1 hr to fix

                                  Method create has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function create(CreateableComponent $component): ComponentResponseBody
                                      {
                                          if (!$component instanceof $this->componentClass) {
                                              $message = 'The object you are trying to create of type ' . \get_class($component) . ' is not a milestone.';
                                              $this->getLogger()->error($message);
                                  Severity: Minor
                                  Found in src/Component/AbstractComponentService.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 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

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language