ernestwisniewski/kbin

View on GitHub

Showing 226 of 573 total issues

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

        Request $request,
        ClientManagerInterface $manager,
        EntityManagerInterface $entityManager,
        CredentialsRevokerInterface $revoker,
        ValidatorInterface $validator,
Severity: Minor
Found in src/Controller/Api/OAuth2/DeleteClientApi.php - About 45 mins to fix

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

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

        public function __invoke(string $body, array $tags): string
        {
            $current = ($this->tagExtract)($body, null) ?? [];
    
            $join = array_unique(array_merge(array_diff($tags, $current)));
    Severity: Minor
    Found in src/Kbin/Tag/TagJoinToBody.php - About 45 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

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

            #[MapEntity(id: 'user_id')]
            User $user,
            PostRepository $repository,
            PostFactory $factory,
            RequestStack $request,
    Severity: Minor
    Found in src/Controller/Api/Post/UserPostsRetrieveApi.php - About 45 mins to fix

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

              #[MapEntity(id: 'magazine_id')]
              Magazine $magazine,
              PostRepository $repository,
              PostFactory $factory,
              RequestStack $request,
      Severity: Minor
      Found in src/Controller/Api/Post/PostsRetrieveApi.php - About 45 mins to fix

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

                SearchManager $manager,
                UserFactory $userFactory,
                MagazineFactory $magazineFactory,
                SettingsManager $settingsManager,
                RateLimiterFactory $apiReadLimiter,
        Severity: Minor
        Found in src/Controller/Api/Search/SearchRetrieveApi.php - About 45 mins to fix

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

              #[Assert\Callback]
              public function validate(
                  ExecutionContextInterface $context,
                  $payload
              ) {
          Severity: Minor
          Found in src/Kbin/EntryComment/DTO/EntryCommentDto.php - About 45 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

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

                  #[MapEntity(id: 'post_id')]
                  Post $post,
                  #[MapEntity(id: 'comment_id')]
                  ?PostComment $parent,
                  PostCommentCreate $postCommentCreate,
          Severity: Minor
          Found in src/Controller/Api/Post/Comments/PostCommentsCreateApi.php - About 45 mins to fix

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

                #[Assert\Callback]
                public function validate(
                    ExecutionContextInterface $context,
                    $payload
                ) {
            Severity: Minor
            Found in src/Kbin/PostComment/DTO/PostCommentDto.php - About 45 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

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

                    #[MapEntity(id: 'domain_id')]
                    Domain $domain,
                    EntryRepository $repository,
                    EntryFactory $factory,
                    RequestStack $request,
            Severity: Minor
            Found in src/Controller/Api/Entry/DomainEntriesRetrieveApi.php - About 45 mins to fix

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

                      int $id,
                      string $reason = null,
                      \DateTimeInterface $expiredAt = null,
                      MagazineSmallResponseDto $magazine = null,
                      UserSmallResponseDto $user = null,
              Severity: Minor
              Found in src/Kbin/Magazine/DTO/MagazineBanResponseDto.php - About 45 mins to fix

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

                        string $body,
                        ?Entry $entry,
                        User $user,
                        EntryComment $parent = null,
                        string $ip = null
                Severity: Minor
                Found in src/Entity/EntryComment.php - About 35 mins to fix

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

                          string $url,
                          string $label,
                          string $title,
                          private string $kbinUsername,
                          private MentionType $type,
                  Severity: Minor
                  Found in src/Markdown/CommonMark/Node/CommunityLink.php - About 35 mins to fix

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

                            string $activityPubUrl,
                            string $label,
                            string $title,
                            private string $kbinUsername,
                            private MentionType $type,
                    Severity: Minor
                    Found in src/Markdown/CommonMark/Node/ActivityPubMentionLink.php - About 35 mins to fix

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

                              ?Magazine $magazine,
                              string $intervalStr,
                              ?\DateTime $start,
                              ?\DateTime $end,
                              ?bool $onlyLocal
                      Severity: Minor
                      Found in src/Repository/StatsVotesRepository.php - About 35 mins to fix

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

                                #[MapEntity(id: 'magazine_id')]
                                Magazine $magazine,
                                #[MapEntity(id: 'user_id')]
                                User $user,
                                MagazineModeratorRemove $magazineModeratorRemove,
                        Severity: Minor
                        Found in src/Controller/Api/Magazine/Admin/MagazineRemoveModeratorsApi.php - About 35 mins to fix

                          Method collection 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 fetchOnline has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    string $topic,
                                    string $mercurePublicUrl,
                                    string $mercureSubscriptionsToken,
                                    HttpClientInterface $httpClient,
                                    CacheInterface $cache
                            Severity: Minor
                            Found in src/Controller/AjaxController.php - About 35 mins to fix

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

                                      string $template,
                                      EntryCommentPageView $criteria,
                                      FormInterface $form,
                                      Request $request,
                                      EntryComment $parent = null,
                              Severity: Minor
                              Found in src/Controller/Entry/Comment/EntryCommentResponseTrait.php - About 35 mins to fix

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

                                        #[MapEntity(id: 'magazine_id')]
                                        Magazine $magazine,
                                        #[MapEntity(id: 'user_id')]
                                        User $user,
                                        MagazineModeratorAdd $magazineModeratorAdd,
                                Severity: Minor
                                Found in src/Controller/Api/Magazine/Admin/MagazineAddModeratorsApi.php - About 35 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language