ernestwisniewski/kbin

View on GitHub

Showing 464 of 573 total issues

Method up has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function up(Schema $schema): void
    {
        // this up() migration is auto-generated, please modify it to your needs
        $this->addSql("INSERT INTO \"public\".\"award_type\" (\"id\", \"name\", \"category\", \"count\", \"attributes\") VALUES
(1, 'bronze_autobiographer', 'bronze', 0, 'a:0:{}'),
Severity: Minor
Found in migrations/Version20230314134010.php - About 1 hr 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/EntryEditedNotification.php and 7 other locations - About 1 hr to fix
    src/Entity/EntryCreatedNotification.php on lines 1..38
    src/Entity/EntryDeletedNotification.php on lines 1..38
    src/Entity/MagazineBanNotification.php on lines 1..38
    src/Entity/MessageNotification.php on lines 1..40
    src/Entity/PostCreatedNotification.php on lines 1..38
    src/Entity/PostDeletedNotification.php on lines 1..38
    src/Entity/PostEditedNotification.php on lines 1..38

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

    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/PostCreatedNotification.php and 7 other locations - About 1 hr to fix
    src/Entity/EntryCreatedNotification.php on lines 1..38
    src/Entity/EntryDeletedNotification.php on lines 1..38
    src/Entity/EntryEditedNotification.php on lines 1..38
    src/Entity/MagazineBanNotification.php on lines 1..38
    src/Entity/MessageNotification.php on lines 1..40
    src/Entity/PostDeletedNotification.php on lines 1..38
    src/Entity/PostEditedNotification.php on lines 1..38

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

    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/MessageNotification.php and 7 other locations - About 1 hr to fix
    src/Entity/EntryCreatedNotification.php on lines 1..38
    src/Entity/EntryDeletedNotification.php on lines 1..38
    src/Entity/EntryEditedNotification.php on lines 1..38
    src/Entity/MagazineBanNotification.php on lines 1..38
    src/Entity/PostCreatedNotification.php on lines 1..38
    src/Entity/PostDeletedNotification.php on lines 1..38
    src/Entity/PostEditedNotification.php on lines 1..38

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

    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/MagazineBanNotification.php and 7 other locations - About 1 hr to fix
    src/Entity/EntryCreatedNotification.php on lines 1..38
    src/Entity/EntryDeletedNotification.php on lines 1..38
    src/Entity/EntryEditedNotification.php on lines 1..38
    src/Entity/MessageNotification.php on lines 1..40
    src/Entity/PostCreatedNotification.php on lines 1..38
    src/Entity/PostDeletedNotification.php on lines 1..38
    src/Entity/PostEditedNotification.php on lines 1..38

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

    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/PostDeletedNotification.php and 7 other locations - About 1 hr to fix
    src/Entity/EntryCreatedNotification.php on lines 1..38
    src/Entity/EntryDeletedNotification.php on lines 1..38
    src/Entity/EntryEditedNotification.php on lines 1..38
    src/Entity/MagazineBanNotification.php on lines 1..38
    src/Entity/MessageNotification.php on lines 1..40
    src/Entity/PostCreatedNotification.php on lines 1..38
    src/Entity/PostEditedNotification.php on lines 1..38

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

    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/EntryDeletedNotification.php and 7 other locations - About 1 hr to fix
    src/Entity/EntryCreatedNotification.php on lines 1..38
    src/Entity/EntryEditedNotification.php on lines 1..38
    src/Entity/MagazineBanNotification.php on lines 1..38
    src/Entity/MessageNotification.php on lines 1..40
    src/Entity/PostCreatedNotification.php on lines 1..38
    src/Entity/PostDeletedNotification.php on lines 1..38
    src/Entity/PostEditedNotification.php on lines 1..38

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

    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 findModerators(
            Magazine $magazine,
            ?int $page = 1,
            int $perPage = self::PER_PAGE
        ): PagerfantaInterface {
    Severity: Major
    Found in src/Repository/MagazineRepository.php and 1 other location - About 1 hr to fix
    src/Repository/MagazineRepository.php on lines 185..199

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

    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/EntryCreatedNotification.php and 7 other locations - About 1 hr to fix
    src/Entity/EntryDeletedNotification.php on lines 1..38
    src/Entity/EntryEditedNotification.php on lines 1..38
    src/Entity/MagazineBanNotification.php on lines 1..38
    src/Entity/MessageNotification.php on lines 1..40
    src/Entity/PostCreatedNotification.php on lines 1..38
    src/Entity/PostDeletedNotification.php on lines 1..38
    src/Entity/PostEditedNotification.php on lines 1..38

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

    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/PostEditedNotification.php and 7 other locations - About 1 hr to fix
    src/Entity/EntryCreatedNotification.php on lines 1..38
    src/Entity/EntryDeletedNotification.php on lines 1..38
    src/Entity/EntryEditedNotification.php on lines 1..38
    src/Entity/MagazineBanNotification.php on lines 1..38
    src/Entity/MessageNotification.php on lines 1..40
    src/Entity/PostCreatedNotification.php on lines 1..38
    src/Entity/PostDeletedNotification.php on lines 1..38

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

    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 findModlog(Magazine $magazine, ?int $page = 1, int $perPage = self::PER_PAGE): PagerfantaInterface
        {
            $criteria = Criteria::create()->orderBy(['createdAt' => 'DESC']);
    
            $logs = new Pagerfanta(new SelectableAdapter($magazine->logs, $criteria));
    Severity: Major
    Found in src/Repository/MagazineRepository.php and 1 other location - About 1 hr to fix
    src/Repository/MagazineRepository.php on lines 167..183

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

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

        public function jsonSerialize(): mixed
        {
            if (null === self::$keysToDelete) {
                self::$keysToDelete = [
                    'domain',
    Severity: Minor
    Found in src/Kbin/Entry/DTO/EntryResponseDto.php - About 1 hr to fix

      Similar blocks of code found in 2 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/DTO/ActivityPub/VideoDto.php and 1 other location - About 1 hr to fix
      src/DTO/ActivityPub/ImageDto.php on lines 1..29

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

      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

      <?php
      
      // SPDX-FileCopyrightText: 2023 /kbin contributors <https://kbin.pub/>
      //
      // SPDX-License-Identifier: AGPL-3.0-only
      Severity: Major
      Found in src/DTO/ActivityPub/ImageDto.php and 1 other location - About 1 hr to fix
      src/DTO/ActivityPub/VideoDto.php on lines 1..29

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

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

          private function filter(QueryBuilder $qb, Criteria $criteria): void
          {
              if ($criteria->post) {
                  $qb->andWhere('c.post = :post')
                      ->setParameter('post', $criteria->post);
      Severity: Minor
      Found in src/Repository/PostCommentRepository.php - About 1 hr to fix

        Function expandComments has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            async expandComments(event) {
                event.preventDefault();
        
                if (this.loadingValue === true) {
                    return;
        Severity: Minor
        Found in assets/controllers/post_controller.js - About 1 hr to fix

          Method up has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function up(Schema $schema): void
              {
                  // this up() migration is auto-generated, please modify it to your needs
                  $this->addSql('CREATE SEQUENCE oauth2_user_consent_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
                  $this->addSql('CREATE TABLE oauth2_access_token (identifier CHAR(80) NOT NULL, client VARCHAR(32) NOT NULL, expiry TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, user_identifier VARCHAR(128) DEFAULT NULL, scopes TEXT DEFAULT NULL, revoked BOOLEAN NOT NULL, PRIMARY KEY(identifier))');
          Severity: Minor
          Found in migrations/Version20230719060447.php - About 1 hr to fix

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

            #[Entity(repositoryClass: PostCommentRepository::class)]
            #[Index(columns: ['up_votes'], name: 'post_comment_up_votes_idx')]
            #[Index(columns: ['score'], name: 'post_comment_score_idx')]
            #[Index(columns: ['last_active'], name: 'post_comment_last_active_at_idx')]
            #[Index(columns: ['created_at'], name: 'post_comment_created_at_idx')]
            Severity: Major
            Found in src/Entity/PostComment.php and 1 other location - About 1 hr to fix
            src/Entity/EntryComment.php on lines 38..241

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

            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

            #[Entity(repositoryClass: EntryCommentRepository::class)]
            #[Index(columns: ['up_votes'], name: 'entry_comment_up_votes_idx')]
            #[Index(columns: ['score'], name: 'entry_comment_score_idx')]
            #[Index(columns: ['last_active'], name: 'entry_comment_last_active_at_idx')]
            #[Index(columns: ['created_at'], name: 'entry_comment_created_at_idx')]
            Severity: Major
            Found in src/Entity/EntryComment.php and 1 other location - About 1 hr to fix
            src/Entity/PostComment.php on lines 38..230

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

            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

            Function expandComments has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

                async expandComments(event) {
                    event.preventDefault();
            
                    if (this.loadingValue === true) {
                        return;
            Severity: Minor
            Found in assets/controllers/post_controller.js - 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

            Severity
            Category
            Status
            Source
            Language