ernestwisniewski/kbin

View on GitHub

Showing 464 of 573 total issues

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

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        public function findBySubject(User $user, FavouriteInterface $subject): ?Favourite
        {
            return match (true) {
                $subject instanceof Entry => $this->findByEntry($user, $subject),
                $subject instanceof EntryComment => $this->findByEntryComment($user, $subject),
    Severity: Minor
    Found in src/Repository/FavouriteRepository.php and 1 other location - About 45 mins to fix
    src/Repository/VoteRepository.php on lines 62..71

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 95.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        public function countLocalComments(): int
        {
            $entryComments = $this->_em->createQueryBuilder()
                ->select('COUNT(ec.id)')
                ->from(EntryComment::class, 'ec')
    Severity: Minor
    Found in src/Repository/StatsContentRepository.php and 1 other location - About 45 mins to fix
    src/Repository/StatsContentRepository.php on lines 248..265

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 95.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        public function countBySubject(VotableInterface $subject, $choice): int
        {
            return match (true) {
                $subject instanceof Entry => $this->countByEntry($subject, $choice),
                $subject instanceof EntryComment => $this->countByEntryComment($subject, $choice),
    Severity: Minor
    Found in src/Repository/VoteRepository.php and 1 other location - About 45 mins to fix
    src/Repository/FavouriteRepository.php on lines 49..58

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 95.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        public function countLocalPosts(): int
        {
            $entries = $this->_em->createQueryBuilder()
                ->select('COUNT(e.id)')
                ->from(Entry::class, 'e')
    Severity: Minor
    Found in src/Repository/StatsContentRepository.php and 1 other location - About 45 mins to fix
    src/Repository/StatsContentRepository.php on lines 267..284

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 95.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Open

    <?php
    
    // SPDX-FileCopyrightText: 2023 /kbin contributors <https://kbin.pub/>
    //
    // SPDX-License-Identifier: AGPL-3.0-only
    Severity: Major
    Found in src/Schema/Errors/TooManyRequestsErrorSchema.php and 4 other locations - About 40 mins to fix
    src/Schema/Errors/BadRequestErrorSchema.php on lines 1..24
    src/Schema/Errors/ForbiddenErrorSchema.php on lines 1..24
    src/Schema/Errors/NotFoundErrorSchema.php on lines 1..24
    src/Schema/Errors/UnauthorizedErrorSchema.php on lines 1..24

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 93.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Open

    <?php
    
    // SPDX-FileCopyrightText: 2023 /kbin contributors <https://kbin.pub/>
    //
    // SPDX-License-Identifier: AGPL-3.0-only
    Severity: Major
    Found in src/Schema/Errors/UnauthorizedErrorSchema.php and 4 other locations - About 40 mins to fix
    src/Schema/Errors/BadRequestErrorSchema.php on lines 1..24
    src/Schema/Errors/ForbiddenErrorSchema.php on lines 1..24
    src/Schema/Errors/NotFoundErrorSchema.php on lines 1..24
    src/Schema/Errors/TooManyRequestsErrorSchema.php on lines 1..24

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 93.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Open

    <?php
    
    // SPDX-FileCopyrightText: 2023 /kbin contributors <https://kbin.pub/>
    //
    // SPDX-License-Identifier: AGPL-3.0-only
    Severity: Major
    Found in src/Schema/Errors/NotFoundErrorSchema.php and 4 other locations - About 40 mins to fix
    src/Schema/Errors/BadRequestErrorSchema.php on lines 1..24
    src/Schema/Errors/ForbiddenErrorSchema.php on lines 1..24
    src/Schema/Errors/TooManyRequestsErrorSchema.php on lines 1..24
    src/Schema/Errors/UnauthorizedErrorSchema.php on lines 1..24

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 93.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Open

    <?php
    
    // SPDX-FileCopyrightText: 2023 /kbin contributors <https://kbin.pub/>
    //
    // SPDX-License-Identifier: AGPL-3.0-only
    Severity: Major
    Found in src/Schema/Errors/BadRequestErrorSchema.php and 4 other locations - About 40 mins to fix
    src/Schema/Errors/ForbiddenErrorSchema.php on lines 1..24
    src/Schema/Errors/NotFoundErrorSchema.php on lines 1..24
    src/Schema/Errors/TooManyRequestsErrorSchema.php on lines 1..24
    src/Schema/Errors/UnauthorizedErrorSchema.php on lines 1..24

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 93.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 5 locations. Consider refactoring.
    Open

    <?php
    
    // SPDX-FileCopyrightText: 2023 /kbin contributors <https://kbin.pub/>
    //
    // SPDX-License-Identifier: AGPL-3.0-only
    Severity: Major
    Found in src/Schema/Errors/ForbiddenErrorSchema.php and 4 other locations - About 40 mins to fix
    src/Schema/Errors/BadRequestErrorSchema.php on lines 1..24
    src/Schema/Errors/NotFoundErrorSchema.php on lines 1..24
    src/Schema/Errors/TooManyRequestsErrorSchema.php on lines 1..24
    src/Schema/Errors/UnauthorizedErrorSchema.php on lines 1..24

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 93.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    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

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

                              #[MapEntity(id: 'post_id')]
                              Post $post,
                              PostFactory $factory,
                              EventDispatcherInterface $dispatcher,
                              RateLimiterFactory $apiReadLimiter,
                      Severity: Minor
                      Found in src/Controller/Api/Post/PostsRetrieveApi.php - About 35 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language