wikimedia/mediawiki-extensions-Wikibase

View on GitHub

Showing 2,096 of 2,096 total issues

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

<?php declare( strict_types = 1 );

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

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/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\GetPropertyDescriptionWithFallback;

use Wikibase\Repo\RestApi\Application\UseCases\GetLatestPropertyRevisionMetadata;
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/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\GetPropertyLabel;

use Wikibase\Repo\RestApi\Application\UseCases\GetLatestPropertyRevisionMetadata;
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/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\GetPropertyLabelWithFallback;

use Wikibase\Repo\RestApi\Application\UseCases\GetLatestPropertyRevisionMetadata;
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/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\GetPropertyAliasesInLanguage;

use Wikibase\Repo\RestApi\Application\UseCases\GetLatestPropertyRevisionMetadata;
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/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 2 locations. Consider refactoring.
Open

$specialPageAliases['en'] = [
    'AvailableBadges' => [ 'AvailableBadges' ],
    'DispatchStats' => [ 'DispatchStats' ],
    'EntityData' => [ 'EntityData' ],
    'EntityPage' => [ 'EntityPage' ],
Severity: Major
Found in repo/Wikibase.i18n.alias.php and 1 other location - About 6 hrs to fix
repo/Wikibase.i18n.alias.php on lines 217..238

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

$specialPageAliases['hi'] = [
    'AvailableBadges' => [ 'उपलब्ध_बैजेस' ],
    'DispatchStats' => [ 'तैनात_सांख्यिकी' ],
    'EntityData' => [ 'सत्ता_डेटा' ],
    'EntityPage' => [ 'सत्ता' ],
Severity: Major
Found in repo/Wikibase.i18n.alias.php and 1 other location - About 6 hrs to fix
repo/Wikibase.i18n.alias.php on lines 13..34

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\GetPropertyDescription;

use Wikibase\Repo\RestApi\Application\UseCases\GetLatestPropertyRevisionMetadata;
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/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

File EntityHandler.php has 428 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace Wikibase\Repo\Content;

use Article;
Severity: Minor
Found in repo/includes/Content/EntityHandler.php - About 6 hrs to fix

    Function exports has 155 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

      File ViewFactory.js has 425 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      ( function ( wb ) {
          'use strict';
      
          var MODULE = wb.view,
              EventSingletonManager = require( '../../jquery/jquery.util.EventSingletonManager.js' ),
      Severity: Minor
      Found in view/resources/wikibase/view/ViewFactory.js - About 6 hrs to fix

        WikibaseLibrary has 45 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class WikibaseLibrary extends LibraryBase implements ParserOutputProvider {
        
            /**
             * @var WikibaseLanguageIndependentLuaBindings|null
             */
        Severity: Minor
        Found in client/includes/DataAccess/Scribunto/WikibaseLibrary.php - About 6 hrs to fix

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

          ( function () {
              'use strict';
          
              var EntityIdHtmlFormatter = require( './EntityIdHtmlFormatter.js' );
          
          
          view/resources/wikibase/entityIdFormatter/CachingEntityIdPlainFormatter.js on lines 1..30

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

          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

          ( function () {
              'use strict';
          
              var EntityIdPlainFormatter = require( './EntityIdPlainFormatter.js' );
          
          
          view/resources/wikibase/entityIdFormatter/CachingEntityIdHtmlFormatter.js on lines 1..30

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

          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 assertValidLabelsAndDescriptions( Property $property, array $serialization ): void {
                  $labels = $serialization['labels'] ?? [];
                  $descriptions = $serialization['descriptions'] ?? [];
                  $validationError = $this->labelsSyntaxValidator->validate( $labels, '/labels' ) ??
                      $this->descriptionsSyntaxValidator->validate( $descriptions, '/descriptions' ) ??
          repo/rest-api/src/Application/UseCases/PatchItem/PatchedItemValidator.php on lines 114..142

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

          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\Deserializers;
          
          use Deserializers\Deserializer;
          lib/packages/wikibase/data-model-serialization/src/Deserializers/SnakListDeserializer.php on lines 1..75

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

          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\Deserializers;
          
          use Deserializers\Deserializer;
          lib/packages/wikibase/data-model-serialization/src/Deserializers/StatementListDeserializer.php on lines 1..75

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

          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 assertValidLabelsAndDescriptions( array $serialization, Item $originalItem ): void {
                  $labels = $serialization['labels'] ?? [];
                  $descriptions = $serialization['descriptions'] ?? [];
                  $validationError = $this->labelsSyntaxValidator->validate( $labels, '/labels' ) ??
                                     $this->descriptionsSyntaxValidator->validate( $descriptions, '/descriptions' ) ??
          repo/rest-api/src/Application/UseCases/PatchProperty/PatchedPropertyValidator.php on lines 119..144

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

          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 23e7 has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
          Open

          /***/ (function(module, exports, __webpack_require__) {
          
          var global = __webpack_require__("da84");
          var getOwnPropertyDescriptor = __webpack_require__("06cf").f;
          var createNonEnumerableProperty = __webpack_require__("9112");
          Severity: Minor
          Found in view/lib/wikibase-tainted-ref/dist/tainted-ref.common.js - About 5 hrs 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

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

          $specialPageAliases['nn'] = [
              'AvailableBadges' => [ 'Tilgjengelige_merke' ],
              'EntityData' => [ 'Entitetsdata' ],
              'EntityPage' => [ 'Entitetsside' ],
              'GoToLinkedPage' => [ 'Gå_til_lenkja_side', 'Gå_til_lenka_side' ],
          Severity: Major
          Found in repo/Wikibase.i18n.alias.php and 1 other location - About 5 hrs to fix
          repo/Wikibase.i18n.alias.php on lines 337..357

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

          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