ernestwisniewski/kbin

View on GitHub

Showing 464 of 573 total issues

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

    #[Assert\Callback]
    public function validate(
        ExecutionContextInterface $context,
        $payload
    ) {
Severity: Major
Found in src/Kbin/Post/DTO/PostDto.php and 2 other locations - About 2 hrs to fix
src/Kbin/EntryComment/DTO/EntryCommentDto.php on lines 56..76
src/Kbin/PostComment/DTO/PostCommentDto.php on lines 56..76

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 137.

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 aggregateStats has 67 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function aggregateStats(?Magazine $magazine, string $interval, ?\DateTime $end): array
    {
        if (null === $end) {
            $end = new \DateTime();
        }
Severity: Major
Found in src/Repository/StatsVotesRepository.php - About 2 hrs to fix

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

        private function getUserReputationVotesCount(User $user): int
        {
            $conn = $this->getEntityManager()
                ->getConnection();
    
    
    Severity: Major
    Found in src/Repository/ReputationRepository.php and 1 other location - About 2 hrs to fix
    src/Repository/ReputationRepository.php on lines 118..134

    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 135.

    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

        private function getUserReputationFavouritesCount(User $user): int
        {
            $conn = $this->getEntityManager()
                ->getConnection();
    
    
    Severity: Major
    Found in src/Repository/ReputationRepository.php and 1 other location - About 2 hrs to fix
    src/Repository/ReputationRepository.php on lines 90..106

    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 135.

    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 create has 21 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            int $id = null,
            UserSmallResponseDto $user = null,
            MagazineSmallResponseDto $magazine = null,
            int $entryId = null,
            int $parentId = null,
    Severity: Major
    Found in src/Kbin/EntryComment/DTO/EntryCommentResponseDto.php - About 2 hrs to fix

      File EntryCommentsCreateApi.php has 271 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      // SPDX-FileCopyrightText: 2023 /kbin contributors <https://kbin.pub/>
      //
      // SPDX-License-Identifier: AGPL-3.0-only
      Severity: Minor
      Found in src/Controller/Api/Entry/Comments/EntryCommentsCreateApi.php - About 2 hrs to fix

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

                public string $KBIN_DOMAIN,
                public string $KBIN_TITLE,
                public string $KBIN_META_TITLE,
                public string $KBIN_META_KEYWORDS,
                public string $KBIN_META_DESCRIPTION,
        Severity: Major
        Found in src/DTO/SettingsDto.php - About 2 hrs to fix

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

                  MagazineModeratorResponseDto $owner = null,
                  ImageDto $icon = null,
                  string $name = null,
                  string $title = null,
                  string $description = null,
          Severity: Major
          Found in src/Kbin/Magazine/DTO/MagazineResponseDto.php - About 2 hrs to fix

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

                    public ?bool $notifyOnNewEntry = null,
                    public ?bool $notifyOnNewEntryReply = null,
                    public ?bool $notifyOnNewEntryCommentReply = null,
                    public ?bool $notifyOnNewPost = null,
                    public ?bool $notifyOnNewPostReply = null,
            Severity: Major
            Found in src/Kbin/User/DTO/UserSettingsDto.php - About 2 hrs to fix

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

                      int $id,
                      UserSmallResponseDto $user = null,
                      MagazineSmallResponseDto $magazine = null,
                      Post $post = null,
                      PostComment $parent = null,
              Severity: Major
              Found in src/Kbin/PostComment/DTO/PostCommentResponseDto.php - About 2 hrs to fix

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

                        int $id,
                        UserSmallResponseDto $user,
                        MagazineSmallResponseDto $magazine,
                        ImageDto $image = null,
                        string $body = null,
                Severity: Major
                Found in src/Kbin/Post/DTO/PostResponseDto.php - About 2 hrs to fix

                  Similar blocks of code found in 8 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/Entity/PostCommentCreatedNotification.php and 7 other locations - About 2 hrs to fix
                  src/Entity/EntryCommentCreatedNotification.php on lines 1..43
                  src/Entity/EntryCommentDeletedNotification.php on lines 1..43
                  src/Entity/EntryCommentEditedNotification.php on lines 1..43
                  src/Entity/EntryCommentReplyNotification.php on lines 1..43
                  src/Entity/PostCommentDeletedNotification.php on lines 1..43
                  src/Entity/PostCommentEditedNotification.php on lines 1..43
                  src/Entity/PostCommentReplyNotification.php on lines 1..43

                  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 130.

                  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 8 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/Entity/PostCommentReplyNotification.php and 7 other locations - About 2 hrs to fix
                  src/Entity/EntryCommentCreatedNotification.php on lines 1..43
                  src/Entity/EntryCommentDeletedNotification.php on lines 1..43
                  src/Entity/EntryCommentEditedNotification.php on lines 1..43
                  src/Entity/EntryCommentReplyNotification.php on lines 1..43
                  src/Entity/PostCommentCreatedNotification.php on lines 1..43
                  src/Entity/PostCommentDeletedNotification.php on lines 1..43
                  src/Entity/PostCommentEditedNotification.php on lines 1..43

                  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 130.

                  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 8 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/Entity/EntryCommentDeletedNotification.php and 7 other locations - About 2 hrs to fix
                  src/Entity/EntryCommentCreatedNotification.php on lines 1..43
                  src/Entity/EntryCommentEditedNotification.php on lines 1..43
                  src/Entity/EntryCommentReplyNotification.php on lines 1..43
                  src/Entity/PostCommentCreatedNotification.php on lines 1..43
                  src/Entity/PostCommentDeletedNotification.php on lines 1..43
                  src/Entity/PostCommentEditedNotification.php on lines 1..43
                  src/Entity/PostCommentReplyNotification.php on lines 1..43

                  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 130.

                  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 3 locations. Consider refactoring.
                  Open

                      #[OA\Response(
                          response: 200,
                          description: 'Views by interval retrieved. These are not guaranteed to be continuous.',
                          content: new OA\JsonContent(
                              properties: [
                  Severity: Major
                  Found in src/Controller/Api/Instance/InstanceRetrieveStatsApi.php and 2 other locations - About 2 hrs to fix
                  src/Controller/Api/Magazine/Admin/MagazineRetrieveStatsApi.php on lines 30..59
                  src/Controller/Api/OAuth2/Admin/RetrieveClientStatsApi.php on lines 25..54

                  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 130.

                  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 8 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/Entity/EntryCommentReplyNotification.php and 7 other locations - About 2 hrs to fix
                  src/Entity/EntryCommentCreatedNotification.php on lines 1..43
                  src/Entity/EntryCommentDeletedNotification.php on lines 1..43
                  src/Entity/EntryCommentEditedNotification.php on lines 1..43
                  src/Entity/PostCommentCreatedNotification.php on lines 1..43
                  src/Entity/PostCommentDeletedNotification.php on lines 1..43
                  src/Entity/PostCommentEditedNotification.php on lines 1..43
                  src/Entity/PostCommentReplyNotification.php on lines 1..43

                  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 130.

                  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 8 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/Entity/EntryCommentEditedNotification.php and 7 other locations - About 2 hrs to fix
                  src/Entity/EntryCommentCreatedNotification.php on lines 1..43
                  src/Entity/EntryCommentDeletedNotification.php on lines 1..43
                  src/Entity/EntryCommentReplyNotification.php on lines 1..43
                  src/Entity/PostCommentCreatedNotification.php on lines 1..43
                  src/Entity/PostCommentDeletedNotification.php on lines 1..43
                  src/Entity/PostCommentEditedNotification.php on lines 1..43
                  src/Entity/PostCommentReplyNotification.php on lines 1..43

                  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 130.

                  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 8 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/Entity/PostCommentDeletedNotification.php and 7 other locations - About 2 hrs to fix
                  src/Entity/EntryCommentCreatedNotification.php on lines 1..43
                  src/Entity/EntryCommentDeletedNotification.php on lines 1..43
                  src/Entity/EntryCommentEditedNotification.php on lines 1..43
                  src/Entity/EntryCommentReplyNotification.php on lines 1..43
                  src/Entity/PostCommentCreatedNotification.php on lines 1..43
                  src/Entity/PostCommentEditedNotification.php on lines 1..43
                  src/Entity/PostCommentReplyNotification.php on lines 1..43

                  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 130.

                  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 3 locations. Consider refactoring.
                  Open

                      #[OA\Response(
                          response: 200,
                          description: 'Accesses by interval retrieved. These are not guaranteed to be continuous.',
                          content: new OA\JsonContent(
                              properties: [
                  Severity: Major
                  Found in src/Controller/Api/OAuth2/Admin/RetrieveClientStatsApi.php and 2 other locations - About 2 hrs to fix
                  src/Controller/Api/Instance/InstanceRetrieveStatsApi.php on lines 25..54
                  src/Controller/Api/Magazine/Admin/MagazineRetrieveStatsApi.php on lines 30..59

                  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 130.

                  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 8 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/Entity/PostCommentEditedNotification.php and 7 other locations - About 2 hrs to fix
                  src/Entity/EntryCommentCreatedNotification.php on lines 1..43
                  src/Entity/EntryCommentDeletedNotification.php on lines 1..43
                  src/Entity/EntryCommentEditedNotification.php on lines 1..43
                  src/Entity/EntryCommentReplyNotification.php on lines 1..43
                  src/Entity/PostCommentCreatedNotification.php on lines 1..43
                  src/Entity/PostCommentDeletedNotification.php on lines 1..43
                  src/Entity/PostCommentReplyNotification.php on lines 1..43

                  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 130.

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language