bnomei/kirby-blueprints

View on GitHub

Showing 32 of 43 total issues

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

    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

      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 options 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/Page.php - About 1 hr to fix

        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

            Function preloadCachedBlueprints has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function preloadCachedBlueprints(): int
                {
                    $cdir = static::cacheDir();
                    if (! $cdir) {
                        return 0;
            Severity: Minor
            Found in classes/Blueprints/BlueprintCache.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 make has 11 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    mixed $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 accept 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/File.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 __construct has 11 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            public mixed $title,
                            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 __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 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 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 permissions 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/User.php - About 50 mins 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
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language