wikimedia/mediawiki-extensions-Wikibase

View on GitHub

Showing 2,096 of 2,096 total issues

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

            Array.prototype.push.apply( changes, this._getTermsChanges(
                newFingerprint.getLabels(),
                oldFingerprint.getLabels(),
                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 85..101

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

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

<?php declare( strict_types=1 );

namespace Wikibase\Repo\RestApi\Application\UseCases\SetSitelink;

use Wikibase\Repo\RestApi\Application\UseCaseRequestValidation\EditMetadataRequest;
repo/rest-api/src/Application/UseCases/AddItemAliasesInLanguage/AddItemAliasesInLanguageRequest.php on lines 1..67
repo/rest-api/src/Application/UseCases/AddPropertyAliasesInLanguage/AddPropertyAliasesInLanguageRequest.php on lines 1..67

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

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

<?php declare( strict_types=1 );

namespace Wikibase\Repo\RestApi\Application\UseCases\AddPropertyAliasesInLanguage;

use Wikibase\Repo\RestApi\Application\UseCaseRequestValidation\EditMetadataRequest;
repo/rest-api/src/Application/UseCases/AddItemAliasesInLanguage/AddItemAliasesInLanguageRequest.php on lines 1..67
repo/rest-api/src/Application/UseCases/SetSitelink/SetSitelinkRequest.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 219.

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

<?php declare( strict_types=1 );

namespace Wikibase\Repo\RestApi\Application\UseCases\AddItemAliasesInLanguage;

use Wikibase\Repo\RestApi\Application\UseCaseRequestValidation\EditMetadataRequest;
repo/rest-api/src/Application/UseCases/AddPropertyAliasesInLanguage/AddPropertyAliasesInLanguageRequest.php on lines 1..67
repo/rest-api/src/Application/UseCases/SetSitelink/SetSitelinkRequest.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 219.

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

        destroy: function () {
            this._tipsy.tip().remove();
            this.element.off( 'mouseenter.' + this.widgetName + ' mouseleave.' + this.widgetName );
            this.element.removeData( 'tipsy' );
            this._tipsy = null;
Severity: Major
Found in view/resources/jquery/wikibase/jquery.wikibase.wbtooltip.js and 1 other location - About 6 hrs to fix
client/resources/jquery.wikibase/jquery.wikibase.wbtooltip.js on lines 136..148

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

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

        destroy: function () {
            this._tipsy.tip().remove();
            this.element.off( 'mouseenter.' + this.widgetName + ' mouseleave.' + this.widgetName );
            this.element.removeData( 'tipsy' );
            this._tipsy = null;
view/resources/jquery/wikibase/jquery.wikibase.wbtooltip.js on lines 134..146

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

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 jquery.wikibase.entityselector.js has 441 lines of code (exceeds 250 allowed). Consider refactoring.
Open

( function () {
    'use strict';

    // TODO: Get rid of MediaWiki context detection by submitting a message provider as option.

Severity: Minor
Found in view/resources/jquery/wikibase/jquery.wikibase.entityselector.js - About 6 hrs to fix

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

    <?php declare( strict_types = 1 );
    
    namespace Wikibase\Repo\RestApi\Application\UseCases\GetItemDescriptionWithFallback;
    
    use Wikibase\Repo\RestApi\Application\UseCases\GetLatestItemRevisionMetadata;
    repo/rest-api/src/Application/UseCases/GetItemDescription/GetItemDescription.php on lines 1..51

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

    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\GetItemDescription;
    
    use Wikibase\Repo\RestApi\Application\UseCases\GetLatestItemRevisionMetadata;
    repo/rest-api/src/Application/UseCases/GetItemDescriptionWithFallback/GetItemDescriptionWithFallback.php on lines 1..47

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

    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

    EntityHandler has 47 functions (exceeds 20 allowed). Consider refactoring.
    Open

    abstract class EntityHandler extends ContentHandler {
    
        /**
         * Added to parser options for EntityContent.
         *
    Severity: Minor
    Found in repo/includes/Content/EntityHandler.php - About 6 hrs to fix

      File WikibaseRepo.datatypes.php has 435 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      /**
       * Definition of data types for use with Wikibase.
       * The array returned by the code below is supposed to be merged into the Repo data types.
      Severity: Minor
      Found in repo/WikibaseRepo.datatypes.php - About 6 hrs to fix

        File MediaWikiEditEntity.php has 435 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        declare( strict_types = 1 );
        
        namespace Wikibase\Repo\EditEntity;
        Severity: Minor
        Found in repo/includes/EditEntity/MediaWikiEditEntity.php - About 6 hrs to fix

          File WbRestApi.php has 434 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php declare( strict_types=1 );
          
          namespace Wikibase\Repo\RestApi;
          
          use MediaWiki\MediaWikiServices;
          Severity: Minor
          Found in repo/rest-api/src/WbRestApi.php - About 6 hrs to fix

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

                private function writeNovalueClass( $localName, $repositoryName ) {
                    $this->writer->about(
                        $this->vocabulary->propertyNamespaceNames[$repositoryName][RdfVocabulary::NSP_NOVALUE],
                        $localName
                    )->a( 'owl', 'Class' );
            Severity: Major
            Found in repo/includes/Rdf/PropertySpecificComponentsRdfBuilder.php and 1 other location - About 6 hrs to fix
            repo/includes/Rdf/PropertyStubRdfBuilder.php on lines 325..339

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

            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

                private function writeNovalueClass( $localName, $repositoryName ) {
                    $this->writer->about(
                        $this->vocabulary->propertyNamespaceNames[$repositoryName][RdfVocabulary::NSP_NOVALUE],
                        $localName
                    )->a( 'owl', 'Class' );
            Severity: Major
            Found in repo/includes/Rdf/PropertyStubRdfBuilder.php and 1 other location - About 6 hrs to fix
            repo/includes/Rdf/PropertySpecificComponentsRdfBuilder.php on lines 213..227

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

            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

                    _moveOffEdge: function ( direction ) {
                        if ( direction === 'previous' ) {
                            var menu = this.options.menu,
                                items = menu.option( 'items' );
                            menu.activate( items[ items.length - 1 ] );
            view/resources/jquery/wikibase/jquery.wikibase.siteselector.js on lines 184..195

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

            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

                    _moveOffEdge: function ( direction ) {
                        if ( direction === 'previous' ) {
                            var menu = this.options.menu,
                                items = menu.option( 'items' );
                            menu.activate( items[ items.length - 1 ] );
            client/resources/jquery.wikibase/jquery.wikibase.siteselector.js on lines 187..198

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

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

            <?php declare( strict_types = 1 );
            
            namespace Wikibase\Repo\RestApi\Application\UseCases\GetItemAliasesInLanguage;
            
            use Wikibase\Repo\RestApi\Application\UseCases\GetLatestItemRevisionMetadata;
            repo/rest-api/src/Application/UseCases/GetItemLabel/GetItemLabel.php on lines 1..51
            repo/rest-api/src/Application/UseCases/GetItemLabelWithFallback/GetItemLabelWithFallback.php on lines 1..51
            repo/rest-api/src/Application/UseCases/GetPropertyAliasesInLanguage/GetPropertyAliasesInLanguage.php on lines 1..46
            repo/rest-api/src/Application/UseCases/GetPropertyDescription/GetPropertyDescription.php on lines 1..45
            repo/rest-api/src/Application/UseCases/GetPropertyDescriptionWithFallback/GetPropertyDescriptionWithFallback.php on lines 1..45
            repo/rest-api/src/Application/UseCases/GetPropertyLabel/GetPropertyLabel.php on lines 1..46
            repo/rest-api/src/Application/UseCases/GetPropertyLabelWithFallback/GetPropertyLabelWithFallback.php on lines 1..46
            repo/rest-api/src/Application/UseCases/GetSitelink/GetSitelink.php on lines 1..47

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

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

            <?php declare( strict_types = 1 );
            
            namespace Wikibase\Repo\RestApi\Application\UseCases\GetItemLabel;
            
            use Wikibase\Repo\RestApi\Application\UseCases\GetLatestItemRevisionMetadata;
            repo/rest-api/src/Application/UseCases/GetItemAliasesInLanguage/GetItemAliasesInLanguage.php on lines 1..49
            repo/rest-api/src/Application/UseCases/GetItemLabelWithFallback/GetItemLabelWithFallback.php on lines 1..51
            repo/rest-api/src/Application/UseCases/GetPropertyAliasesInLanguage/GetPropertyAliasesInLanguage.php on lines 1..46
            repo/rest-api/src/Application/UseCases/GetPropertyDescription/GetPropertyDescription.php on lines 1..45
            repo/rest-api/src/Application/UseCases/GetPropertyDescriptionWithFallback/GetPropertyDescriptionWithFallback.php on lines 1..45
            repo/rest-api/src/Application/UseCases/GetPropertyLabel/GetPropertyLabel.php on lines 1..46
            repo/rest-api/src/Application/UseCases/GetPropertyLabelWithFallback/GetPropertyLabelWithFallback.php on lines 1..46
            repo/rest-api/src/Application/UseCases/GetSitelink/GetSitelink.php on lines 1..47

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

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

            <?php declare( strict_types=1 );
            
            namespace Wikibase\Repo\RestApi\Application\UseCases\GetSitelink;
            
            use Wikibase\Repo\RestApi\Application\UseCases\GetLatestItemRevisionMetadata;
            repo/rest-api/src/Application/UseCases/GetItemAliasesInLanguage/GetItemAliasesInLanguage.php on lines 1..49
            repo/rest-api/src/Application/UseCases/GetItemLabel/GetItemLabel.php on lines 1..51
            repo/rest-api/src/Application/UseCases/GetItemLabelWithFallback/GetItemLabelWithFallback.php on lines 1..51
            repo/rest-api/src/Application/UseCases/GetPropertyAliasesInLanguage/GetPropertyAliasesInLanguage.php on lines 1..46
            repo/rest-api/src/Application/UseCases/GetPropertyDescription/GetPropertyDescription.php on lines 1..45
            repo/rest-api/src/Application/UseCases/GetPropertyDescriptionWithFallback/GetPropertyDescriptionWithFallback.php on lines 1..45
            repo/rest-api/src/Application/UseCases/GetPropertyLabel/GetPropertyLabel.php on lines 1..46
            repo/rest-api/src/Application/UseCases/GetPropertyLabelWithFallback/GetPropertyLabelWithFallback.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 210.

            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