bnomei/kirby-blueprints

View on GitHub

Showing 27 of 35 total issues

Method make has 28 arguments (exceeds 4 allowed). Consider refactoring.
Open

        string|SectionTypes $type,
        array $fields = [],
        array $columns = [],
        mixed $empty = null,
        ?bool $flip = null,
Severity: Major
Found in classes/Blueprints/Schema/Section.php - About 3 hrs to fix

    Method __construct has 28 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            public string|SectionTypes $type,
            public array $fields = [],
            public array $columns = [],
            public mixed $empty = null,
            public ?bool $flip = null,
    Severity: Major
    Found in classes/Blueprints/Schema/Section.php - About 3 hrs to fix

      Function __destruct has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
      Open

          public function __destruct()
          {
              /** @var \Kirby\Cms\ModelWithContent $this */
              $key = $this->blueprintCacheKey();
              if (static::$blueprintCache) {
      Severity: Minor
      Found in classes/Blueprints/HasBlueprintCache.php - About 3 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 __construct has 12 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              public bool|array $changeSlug = true,
              public bool|array $changeStatus = true,
              public bool|array $changeTemplate = true,
              public bool|array $changeTitle = true,
              public bool|array $create = true,
      Severity: Major
      Found in classes/Blueprints/Schema/PageOptions.php - About 1 hr to fix

        Method make has 12 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                bool|array $changeSlug = true,
                bool|array $changeStatus = true,
                bool|array $changeTemplate = true,
                bool|array $changeTitle = true,
                bool|array $create = true,
        Severity: Major
        Found in classes/Blueprints/Schema/PageOptions.php - About 1 hr to fix

          Method __construct has 11 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  public string $title, // TODO: should be an string OR array of languages
                  public ?string $num = null,
                  public mixed $status = null,
                  public mixed $icon = null,
                  public mixed $image = null,
          Severity: Major
          Found in classes/Blueprints/Schema/Page.php - About 1 hr to fix

            Method make has 11 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    string $title,
                    ?string $num = null,
                    mixed $status = null,
                    mixed $icon = null,
                    mixed $image = null,
            Severity: Major
            Found in classes/Blueprints/Schema/Page.php - About 1 hr to fix

              Method __construct has 11 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      public null|string|array $extension = null,
                      public null|string|array $mime = null,
                      public ?int $maxheight = null,
                      public ?int $maxsize = null,
                      public ?int $maxwidth = null,
              Severity: Major
              Found in classes/Blueprints/Schema/FileAccept.php - About 1 hr to fix

                Method make has 11 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        string|array|null $extension = null,
                        string|array|null $mime = null,
                        ?int $maxheight = null,
                        ?int $maxsize = null,
                        ?int $maxwidth = null,
                Severity: Major
                Found in classes/Blueprints/Schema/FileAccept.php - About 1 hr to fix

                  Method make has 10 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          string $name,
                          string $title,
                          ?string $description = null,
                          ?string $home = null,
                          mixed $image = null,
                  Severity: Major
                  Found in classes/Blueprints/Schema/User.php - About 1 hr to fix

                    Method __construct has 10 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            public string $name,
                            public string $title, // TODO: should be an string OR array of languages
                            public ?string $description = null, // TODO: should be an string OR array of languages
                            public ?string $home = null,
                            public mixed $image = null,
                    Severity: Major
                    Found in classes/Blueprints/Schema/User.php - About 1 hr to fix

                      Method make has 8 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              string $title,
                              mixed $image = null,
                              mixed $accept = null,
                              mixed $options = null,
                              array $tabs = [],
                      Severity: Major
                      Found in classes/Blueprints/Schema/File.php - About 1 hr to fix

                        Method __construct has 8 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                public string $title, // TODO: should be an string OR array of languages
                                public mixed $image = null,
                                public mixed $accept = null,
                                public mixed $options = null,
                                public array $tabs = [],
                        Severity: Major
                        Found in classes/Blueprints/Schema/File.php - About 1 hr to fix

                          Method __construct has 7 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  public bool|array $access = true,
                                  public bool|array $files = true,
                                  public bool|array $pages = true,
                                  public bool|array $site = true,
                                  public bool|array $user = true,
                          Severity: Major
                          Found in classes/Blueprints/Schema/UserPermissions.php - About 50 mins to fix

                            Method make has 7 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    bool|array $access = true,
                                    bool|array $files = true,
                                    bool|array $pages = true,
                                    bool|array $site = true,
                                    bool|array $user = true,
                            Severity: Major
                            Found in classes/Blueprints/Schema/UserPermissions.php - About 50 mins to fix

                              Method make has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                      array|string $label,
                                      ?Icon $icon = null,
                                      ?string $id = null,
                                      array $columns = [],
                                      array $sections = [],
                              Severity: Minor
                              Found in classes/Blueprints/Schema/Tab.php - About 45 mins to fix

                                Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                        public string $title, // TODO: should be an string OR array of languages
                                        public mixed $options = null,
                                        public array $tabs = [],
                                        public array $columns = [],
                                        public array $sections = [],
                                Severity: Minor
                                Found in classes/Blueprints/Schema/Site.php - About 45 mins to fix

                                  Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                          public string|array $label = '',
                                          public ?Icon $icon = null,
                                          public ?string $id = null,
                                          public array $columns = [],
                                          public array $sections = [],
                                  Severity: Minor
                                  Found in classes/Blueprints/Schema/Tab.php - About 45 mins to fix

                                    Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                            public bool|array $changeName = true,
                                            public bool|array $replace = true,
                                            public bool|array $delete = true,
                                            public bool|array $read = true,
                                            public bool|array $update = true,
                                    Severity: Minor
                                    Found in classes/Blueprints/Schema/FileOptions.php - About 45 mins to fix

                                      Method make has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                              string $title,
                                              mixed $options = null,
                                              array $tabs = [],
                                              array $columns = [],
                                              array $sections = [],
                                      Severity: Minor
                                      Found in classes/Blueprints/Schema/Site.php - About 45 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language