ernestwisniewski/kbin

View on GitHub

Showing 226 of 573 total issues

Method favourited has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        PostRepository $repository,
        PostFactory $factory,
        RequestStack $request,
        RateLimiterFactory $apiReadLimiter,
        RateLimiterFactory $anonymousApiReadLimiter
Severity: Minor
Found in src/Controller/Api/Post/PostsRetrieveApi.php - About 35 mins to fix

    Method setSubject has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            Entry|EntryComment|Post|PostComment|null $subject,
            EntryFactory $entryFactory,
            EntryCommentFactory $entryCommentFactory,
            PostFactory $postFactory,
            PostCommentFactory $postCommentFactory,
    Severity: Minor
    Found in src/Kbin/Magazine/DTO/MagazineLogResponseDto.php - About 35 mins to fix

      Method __invoke has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              #[MapEntity(id: 'comment_id')]
              EntryComment $comment,
              int $choice,
              VoteCreate $voteCreate,
              EntryCommentFactory $factory,
      Severity: Minor
      Found in src/Controller/Api/Entry/Comments/EntryCommentsVoteApi.php - About 35 mins to fix

        Method create has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                int $magazineId = null,
                int $userId = null,
                string $username = null,
                string $apId = null,
                ImageDto $avatar = null
        Severity: Minor
        Found in src/Kbin/Magazine/DTO/MagazineModeratorResponseDto.php - About 35 mins to fix

          Method profile has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  UserEdit $userEdit,
                  UserFactory $userFactory,
                  ValidatorInterface $validator,
                  UserFactory $factory,
                  RateLimiterFactory $apiUpdateLimiter
          Severity: Minor
          Found in src/Controller/Api/User/UserUpdateApi.php - About 35 mins to fix

            Method __invoke has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    #[MapEntity(id: 'entry_id')]
                    Entry $entry,
                    #[MapEntity(id: 'target_id')]
                    Magazine $target,
                    EntryMagazineChange $entryMagazineChange,
            Severity: Minor
            Found in src/Controller/Api/Entry/Admin/EntriesChangeMagazineApi.php - About 35 mins to fix

              Method __invoke has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      #[MapEntity(id: 'comment_id')]
                      PostComment $comment,
                      PostCommentEdit $postCommentEdit,
                      PostCommentFactory $factory,
                      ValidatorInterface $validator,
              Severity: Minor
              Found in src/Controller/Api/Post/Comments/PostCommentsUpdateApi.php - About 35 mins to fix

                Method __invoke has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        #[MapEntity(id: 'comment_id')]
                        EntryComment $comment,
                        EntryCommentEdit $entryCommentEdit,
                        EntryCommentFactory $factory,
                        ValidatorInterface $validator,
                Severity: Minor
                Found in src/Controller/Api/Entry/Comments/EntryCommentsUpdateApi.php - About 35 mins to fix

                  Method __invoke has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          SiteRepository $repository,
                          EntityManagerInterface $entityManager,
                          SerializerInterface $serializer,
                          ValidatorInterface $validator,
                          RateLimiterFactory $apiModerateLimiter
                  Severity: Minor
                  Found in src/Controller/Api/Instance/Admin/InstanceUpdatePagesApi.php - About 35 mins to fix

                    Method uploadImage has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            #[MapEntity(id: 'magazine_id')]
                            Magazine $magazine,
                            ValidatorInterface $validator,
                            EntryCreate $entryCreate,
                            EntryFactory $entryFactory,
                    Severity: Minor
                    Found in src/Controller/Api/Entry/MagazineEntryCreateApi.php - About 35 mins to fix

                      Method collection has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              EntryRepository $repository,
                              EntryFactory $factory,
                              RequestStack $request,
                              RateLimiterFactory $apiReadLimiter,
                              RateLimiterFactory $anonymousApiReadLimiter,
                      Severity: Minor
                      Found in src/Controller/Api/Entry/EntriesRetrieveApi.php - About 35 mins to fix

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

                                string $email = null,
                                string $username = null,
                                string $url = null,
                                bool $isActive = false,
                                User $user = null
                        Severity: Minor
                        Found in src/Kbin/Donor/DTO/DonorDto.php - About 35 mins to fix

                          Method __invoke has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  #[MapEntity(id: 'comment_id')]
                                  PostComment $comment,
                                  int $choice,
                                  VoteCreate $voteCreate,
                                  PostCommentFactory $factory,
                          Severity: Minor
                          Found in src/Controller/Api/Post/Comments/PostCommentsVoteApi.php - About 35 mins to fix

                            Method __invoke has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    #[MapEntity(id: 'user_id')]
                                    User $user,
                                    EntryCommentRepository $repository,
                                    RequestStack $request,
                                    RateLimiterFactory $apiReadLimiter,
                            Severity: Minor
                            Found in src/Controller/Api/Entry/Comments/UserEntryCommentsRetrieveApi.php - About 35 mins to fix

                              Method __invoke has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                      #[MapEntity(id: 'entry_id')]
                                      Entry $entry,
                                      int $choice,
                                      VoteCreate $voteCreate,
                                      EntryFactory $factory,
                              Severity: Minor
                              Found in src/Controller/Api/Entry/EntriesVoteApi.php - About 35 mins to fix

                                Method __invoke has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                        #[MapEntity(id: 'entry_id')]
                                        Entry $entry,
                                        EntryFactory $factory,
                                        EventDispatcherInterface $dispatcher,
                                        RateLimiterFactory $apiReadLimiter,
                                Severity: Minor
                                Found in src/Controller/Api/Entry/EntriesRetrieveApi.php - About 35 mins to fix

                                  Method __invoke has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                          #[MapEntity(id: 'domain_id')]
                                          Domain $domain,
                                          EntryCommentRepository $repository,
                                          RequestStack $request,
                                          RateLimiterFactory $apiReadLimiter,
                                  Severity: Minor
                                  Found in src/Controller/Api/Entry/Comments/DomainEntryCommentsRetrieveApi.php - About 35 mins to fix

                                    Function validate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        #[Assert\Callback]
                                        public function validate(
                                            ExecutionContextInterface $context,
                                            $payload
                                        ) {
                                    Severity: Minor
                                    Found in src/DTO/OAuth2ClientDto.php - About 35 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 handleInput has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        handleInput (event) {
                                            // ctrl + enter to submit form
                                            if (event.ctrlKey && event.key === "Enter") {
                                                this.element.form.submit();
                                            }
                                    Severity: Minor
                                    Found in assets/controllers/rich_textarea_controller.js - About 35 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 blurhash has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        public function blurhash(string $filePath): ?string
                                        {
                                            try {
                                                $image = imagecreatefromstring(file_get_contents($filePath));
                                                $width = imagesx($image);
                                    Severity: Minor
                                    Found in src/Repository/ImageRepository.php - About 35 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