wikimedia/mediawiki-extensions-Wikibase

View on GitHub

Showing 2,096 of 2,096 total issues

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

    'WikibaseClient.CompactEntitySerializer' => function ( MediaWikiServices $services ): Serializer {
        $serializerFactoryCallbacks = WikibaseClient::getEntityTypeDefinitions( $services )
            ->get( EntityTypeDefinitions::SERIALIZER_FACTORY_CALLBACK );
        $baseSerializerFactory = WikibaseClient::getCompactBaseDataModelSerializerFactory( $services );
        $serializers = [];
Severity: Major
Found in client/WikibaseClient.ServiceWiring.php and 3 other locations - About 45 mins to fix
repo/WikibaseRepo.ServiceWiring.php on lines 278..289
repo/WikibaseRepo.ServiceWiring.php on lines 437..448
repo/WikibaseRepo.ServiceWiring.php on lines 1827..1838

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

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

    'WikibaseRepo.StorageEntitySerializer' => function ( MediaWikiServices $services ): Serializer {
        $serializerFactoryCallbacks = WikibaseRepo::getEntityTypeDefinitions( $services )
            ->get( EntityTypeDefinitions::STORAGE_SERIALIZER_FACTORY_CALLBACK );
        $baseSerializerFactory = WikibaseRepo::getBaseDataModelSerializerFactory( $services );
        $serializers = [];
Severity: Major
Found in repo/WikibaseRepo.ServiceWiring.php and 3 other locations - About 45 mins to fix
client/WikibaseClient.ServiceWiring.php on lines 220..231
repo/WikibaseRepo.ServiceWiring.php on lines 278..289
repo/WikibaseRepo.ServiceWiring.php on lines 437..448

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

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

    'WikibaseRepo.CompactEntitySerializer' => function ( MediaWikiServices $services ): Serializer {
        $serializerFactoryCallbacks = WikibaseRepo::getEntityTypeDefinitions( $services )
            ->get( EntityTypeDefinitions::SERIALIZER_FACTORY_CALLBACK );
        $baseSerializerFactory = WikibaseRepo::getCompactBaseDataModelSerializerFactory( $services );
        $serializers = [];
Severity: Major
Found in repo/WikibaseRepo.ServiceWiring.php and 3 other locations - About 45 mins to fix
client/WikibaseClient.ServiceWiring.php on lines 220..231
repo/WikibaseRepo.ServiceWiring.php on lines 278..289
repo/WikibaseRepo.ServiceWiring.php on lines 1827..1838

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

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

    'WikibaseRepo.AllTypesEntitySerializer' => function ( MediaWikiServices $services ): Serializer {
        $serializerFactoryCallbacks = WikibaseRepo::getEntityTypeDefinitions( $services )
            ->get( EntityTypeDefinitions::SERIALIZER_FACTORY_CALLBACK );
        $baseSerializerFactory = WikibaseRepo::getBaseDataModelSerializerFactory( $services );
        $serializers = [];
Severity: Major
Found in repo/WikibaseRepo.ServiceWiring.php and 3 other locations - About 45 mins to fix
client/WikibaseClient.ServiceWiring.php on lines 220..231
repo/WikibaseRepo.ServiceWiring.php on lines 437..448
repo/WikibaseRepo.ServiceWiring.php on lines 1827..1838

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    public function __construct(
        ApiQuery $query,
        string $moduleName,
        AliasTermBuffer $aliasTermBuffer,
        EntityIdLookup $idLookup,
Severity: Minor
Found in client/includes/Api/PageTerms.php and 1 other location - About 45 mins to fix
repo/includes/Api/EntityTerms.php on lines 51..64

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    public function __construct(
        ApiQuery $query,
        string $moduleName,
        AliasTermBuffer $aliasTermBuffer,
        EntityIdLookup $idLookup,
Severity: Minor
Found in repo/includes/Api/EntityTerms.php and 1 other location - About 45 mins to fix
client/includes/Api/PageTerms.php on lines 53..66

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

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

                    touchesViewportHorizontally = rect.right >= 0 && rect.right < wWidth
                        || rect.left >= 0 && rect.left < wWidth,
view/resources/jquery/wikibase/jquery.wikibase.sitelinklistview.js on lines 336..337

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

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

                    touchesViewportVertically = rect.top >= 0 && rect.top < wHeight
                        || rect.bottom >= 0 && rect.bottom < wHeight;
view/resources/jquery/wikibase/jquery.wikibase.sitelinklistview.js on lines 334..335

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

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

    [ GET_POPPER_STATE ]( state: Application ): Function {
        return ( guid: string ): boolean => {
            return state.statementsPopperIsOpen[ guid ];
        };
    },
Severity: Major
Found in view/lib/wikibase-tainted-ref/src/store/getters.ts and 2 other locations - About 40 mins to fix
view/lib/wikibase-tainted-ref/src/store/getters.ts on lines 11..15
view/lib/wikibase-tainted-ref/src/store/getters.ts on lines 21..25

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    public postWithEditToken<action extends ApiAction>(
        params: ApiParams<action>,
    ): Promise<unknown> {
        return Promise.resolve( // turn jQuery promise into native one
            this.api.postWithEditToken( this.mapParameters( params ) )
Severity: Minor
Found in client/data-bridge/src/data-access/ApiCore.ts and 1 other location - About 40 mins to fix
client/data-bridge/src/data-access/ApiCore.ts on lines 50..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 49.

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

    [ GET_STATEMENT_TAINTED_STATE ]( state: Application ): Function {
        return ( guid: string ): boolean => {
            return state.statementsTaintedState[ guid ];
        };
    },
Severity: Major
Found in view/lib/wikibase-tainted-ref/src/store/getters.ts and 2 other locations - About 40 mins to fix
view/lib/wikibase-tainted-ref/src/store/getters.ts on lines 16..20
view/lib/wikibase-tainted-ref/src/store/getters.ts on lines 21..25

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

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

    [ GET_EDIT_STATE ]( state: Application ): Function {
        return ( guid: string ): boolean => {
            return state.statementsEditState[ guid ];
        };
    },
Severity: Major
Found in view/lib/wikibase-tainted-ref/src/store/getters.ts and 2 other locations - About 40 mins to fix
view/lib/wikibase-tainted-ref/src/store/getters.ts on lines 11..15
view/lib/wikibase-tainted-ref/src/store/getters.ts on lines 16..20

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    public get<action extends ApiAction>( params: ApiParams<action> ): Promise<ApiResponsesMap[action]> {
        return Promise.resolve( // turn jQuery promise into native one
            this.api.get( this.mapParameters( params ) )
                .catch( this.mwApiRejectionToError ),
        );
Severity: Minor
Found in client/data-bridge/src/data-access/ApiCore.ts and 1 other location - About 40 mins to fix
client/data-bridge/src/data-access/ApiCore.ts on lines 41..48

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

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

    public function __construct(
        SiteLookup $siteLookup,
        SiteLinkLookup $siteLinkLookup,
        EntityRedirectTargetLookup $redirectLookup,
        EntityIdParser $idParser,
Severity: Major
Found in repo/includes/Specials/SpecialGoToLinkedPage.php and 2 other locations - About 40 mins to fix
repo/includes/Specials/SpecialListProperties.php on lines 66..80
repo/includes/Specials/SpecialRedirectEntity.php on lines 33..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 94.

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

    public function __construct( $statementGuid, $referenceHash ) {
        if ( !is_string( $statementGuid ) || $statementGuid === '' ) {
            throw new InvalidArgumentException( '$statementGuid needs to be a string and must not be empty' );
        }

Severity: Major
Found in repo/includes/ChangeOp/ChangeOpReferenceRemove.php and 2 other locations - About 40 mins to fix
lib/includes/DataType.php on lines 41..52
repo/includes/ChangeOp/ChangeOpQualifierRemove.php on lines 39..50

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

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

    public function __construct( $statementGuid, $snakHash ) {
        if ( !is_string( $statementGuid ) || $statementGuid === '' ) {
            throw new InvalidArgumentException( '$statementGuid needs to be a string and must not be empty' );
        }

Severity: Major
Found in repo/includes/ChangeOp/ChangeOpQualifierRemove.php and 2 other locations - About 40 mins to fix
lib/includes/DataType.php on lines 41..52
repo/includes/ChangeOp/ChangeOpReferenceRemove.php on lines 39..50

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

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

    protected function getPropertyOrderWikitext() {
        $wikiPage = $this->wikiPageFactory->newFromTitle( $this->pageTitle );

        $pageContent = $wikiPage->getContent();

Severity: Minor
Found in lib/includes/Store/WikiPagePropertyOrderProvider.php and 1 other location - About 40 mins to fix
lib/includes/Store/WikiPageItemOrderProvider.php on lines 60..76

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 94.

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

    public function __construct( $typeId, $dataValueType ) {
        if ( !is_string( $typeId ) || $typeId === '' ) {
            throw new InvalidArgumentException( '$typeId must be a non-empty string' );
        }

Severity: Major
Found in lib/includes/DataType.php and 2 other locations - About 40 mins to fix
repo/includes/ChangeOp/ChangeOpQualifierRemove.php on lines 39..50
repo/includes/ChangeOp/ChangeOpReferenceRemove.php on lines 39..50

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

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

    public function __construct(
        DataTypeFactory $dataTypeFactory,
        PropertyInfoLookup $propertyInfoLookup,
        FallbackLabelDescriptionLookupFactory $labelDescriptionLookupFactory,
        EntityIdFormatterFactory $entityIdFormatterFactory,
Severity: Major
Found in repo/includes/Specials/SpecialListProperties.php and 2 other locations - About 40 mins to fix
repo/includes/Specials/SpecialGoToLinkedPage.php on lines 64..78
repo/includes/Specials/SpecialRedirectEntity.php on lines 33..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 94.

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

    protected function getItemOrderWikitext(): ?string {
        $wikiPage = $this->wikiPageFactory->newFromTitle( $this->pageTitle );

        $pageContent = $wikiPage->getContent();

Severity: Minor
Found in lib/includes/Store/WikiPageItemOrderProvider.php and 1 other location - About 40 mins to fix
lib/includes/Store/WikiPagePropertyOrderProvider.php on lines 43..57

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

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