wikimedia/mediawiki-extensions-Wikibase

View on GitHub

Showing 2,096 of 2,096 total issues

File WikibaseLibrary.php has 483 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

declare( strict_types = 1 );

namespace Wikibase\Client\DataAccess\Scribunto;
Severity: Minor
Found in client/includes/DataAccess/Scribunto/WikibaseLibrary.php - About 7 hrs to fix

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

    <?php declare( strict_types = 1 );
    
    namespace Wikibase\Repo\RestApi\Domain\Model;
    
    use Wikibase\DataModel\Term\Term;
    Severity: Major
    Found in repo/rest-api/src/Domain/Model/DescriptionEditSummary.php and 1 other location - About 7 hrs to fix
    repo/rest-api/src/Domain/Model/LabelEditSummary.php on lines 1..46

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

    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
    
    namespace Wikibase\DataModel\Term;
    
    use InvalidArgumentException;
    Severity: Major
    Found in lib/packages/wikibase/data-model/src/Term/TermFallback.php and 1 other location - About 7 hrs to fix
    lib/packages/wikibase/data-model/src/Term/AliasGroupFallback.php on lines 1..92

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

    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 declare( strict_types=1 );
    
    namespace Wikibase\Repo\RestApi\Application\UseCases\CreateProperty;
    
    use Wikibase\Repo\RestApi\Application\UseCases\AssertUserIsAuthorized;
    repo/rest-api/src/Application/UseCases/CreateItem/CreateItem.php on lines 1..55

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

    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 declare( strict_types=1 );
    
    namespace Wikibase\Repo\RestApi\Domain\Model;
    
    use Wikibase\DataModel\Term\Term;
    Severity: Major
    Found in repo/rest-api/src/Domain/Model/LabelEditSummary.php and 1 other location - About 7 hrs to fix
    repo/rest-api/src/Domain/Model/DescriptionEditSummary.php on lines 1..45

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

    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
    
    namespace Wikibase\DataModel\Term;
    
    use InvalidArgumentException;
    lib/packages/wikibase/data-model/src/Term/TermFallback.php on lines 1..84

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

    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 declare( strict_types=1 );
    
    namespace Wikibase\Repo\RestApi\Application\UseCases\CreateItem;
    
    use Wikibase\Repo\RestApi\Application\UseCases\AssertUserIsAuthorized;
    repo/rest-api/src/Application/UseCases/CreateProperty/CreateProperty.php on lines 1..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 231.

    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 declare( strict_types=1 );
    
    namespace Wikibase\Repo\RestApi\Domain\ReadModel;
    
    use Wikibase\DataModel\Statement\StatementGuid;
    Severity: Major
    Found in repo/rest-api/src/Domain/ReadModel/Statement.php and 1 other location - About 7 hrs to fix
    repo/rest-api/src/Domain/ReadModel/Item.php on lines 1..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 229.

    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 declare( strict_types=1 );
    
    namespace Wikibase\Repo\RestApi\Domain\ReadModel;
    
    use Wikibase\DataModel\Entity\ItemId;
    Severity: Major
    Found in repo/rest-api/src/Domain/ReadModel/Item.php and 1 other location - About 7 hrs to fix
    repo/rest-api/src/Domain/ReadModel/Statement.php on lines 1..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 229.

    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

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

            _selectFirstSite: function () {
                var menu = this.options.menu,
                    menuItems = menu.option( 'items' ),
                    site = null;
    
    
    view/resources/jquery/wikibase/jquery.wikibase.siteselector.js on lines 110..130

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

    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

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

            _selectFirstSite: function () {
                var menu = this.options.menu,
                    menuItems = menu.option( 'items' ),
                    site = null;
    
    
    client/resources/jquery.wikibase/jquery.wikibase.siteselector.js on lines 113..133

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

    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

    File Wikibase.i18n.alias.php has 464 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    /**
     * Aliases for the special pages of the Wikibase Repository extension.
     *
    Severity: Minor
    Found in repo/Wikibase.i18n.alias.php - About 7 hrs to fix

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

      <?php declare( strict_types = 1 );
      
      namespace Wikibase\Repo\RestApi\Application\UseCases\SetItemDescription;
      
      use Wikibase\Repo\RestApi\Application\UseCaseRequestValidation\EditMetadataRequest;
      repo/rest-api/src/Application/UseCases/SetItemLabel/SetItemLabelRequest.php on lines 1..68
      repo/rest-api/src/Application/UseCases/SetPropertyDescription/SetPropertyDescriptionRequest.php on lines 1..68
      repo/rest-api/src/Application/UseCases/SetPropertyLabel/SetPropertyLabelRequest.php on lines 1..68

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

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

      <?php declare( strict_types=1 );
      
      namespace Wikibase\Repo\RestApi\Application\UseCases\SetItemLabel;
      
      use Wikibase\Repo\RestApi\Application\UseCaseRequestValidation\EditMetadataRequest;
      repo/rest-api/src/Application/UseCases/SetItemDescription/SetItemDescriptionRequest.php on lines 1..67
      repo/rest-api/src/Application/UseCases/SetPropertyDescription/SetPropertyDescriptionRequest.php on lines 1..68
      repo/rest-api/src/Application/UseCases/SetPropertyLabel/SetPropertyLabelRequest.php on lines 1..68

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

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

      <?php declare( strict_types=1 );
      
      namespace Wikibase\Repo\RestApi\Application\UseCases\SetPropertyLabel;
      
      use Wikibase\Repo\RestApi\Application\UseCaseRequestValidation\EditMetadataRequest;
      repo/rest-api/src/Application/UseCases/SetItemDescription/SetItemDescriptionRequest.php on lines 1..67
      repo/rest-api/src/Application/UseCases/SetItemLabel/SetItemLabelRequest.php on lines 1..68
      repo/rest-api/src/Application/UseCases/SetPropertyDescription/SetPropertyDescriptionRequest.php on lines 1..68

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

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

      <?php declare( strict_types = 1 );
      
      namespace Wikibase\Repo\RestApi\Application\UseCases\SetPropertyDescription;
      
      use Wikibase\Repo\RestApi\Application\UseCaseRequestValidation\EditMetadataRequest;
      repo/rest-api/src/Application/UseCases/SetItemDescription/SetItemDescriptionRequest.php on lines 1..67
      repo/rest-api/src/Application/UseCases/SetItemLabel/SetItemLabelRequest.php on lines 1..68
      repo/rest-api/src/Application/UseCases/SetPropertyLabel/SetPropertyLabelRequest.php on lines 1..68

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

      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 newSuccessHttpResponse( CreateItemResponse $useCaseResponse ): Response {
              $response = $this->getResponseFactory()->create();
              $response->setStatus( 201 );
              $response->setHeader( 'Content-Type', 'application/json' );
              $response->setHeader(
      Severity: Major
      Found in repo/rest-api/src/RouteHandlers/CreateItemRouteHandler.php and 1 other location - About 7 hrs to fix
      repo/rest-api/src/RouteHandlers/CreatePropertyRouteHandler.php on lines 144..182

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

      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 newSuccessHttpResponse( CreatePropertyResponse $useCaseResponse ): Response {
              $response = $this->getResponseFactory()->create();
              $response->setStatus( 201 );
              $response->setHeader( 'Content-Type', 'application/json' );
              $response->setHeader(
      repo/rest-api/src/RouteHandlers/CreateItemRouteHandler.php on lines 143..174

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

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

      wikibase.view.ControllerViewFactory = ( function ( wb ) {
          'use strict';
      
          var ViewFactory = require( './ViewFactory.js' ),
              ToolbarViewController = require( './ToolbarViewController.js' );
      Severity: Major
      Found in view/resources/wikibase/view/ControllerViewFactory.js - About 6 hrs to fix

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

                    Array.prototype.push.apply( changes, this._getTermsChanges(
                        newFingerprint.getDescriptions(),
                        oldFingerprint.getDescriptions(),
                        function ( newTerm ) {
                            return function () {
        Severity: Major
        Found in view/resources/wikibase/entityChangers/EntityTermsChanger.js and 1 other location - About 6 hrs to fix
        view/resources/wikibase/entityChangers/EntityTermsChanger.js on lines 68..84

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

        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