wikimedia/mediawiki-extensions-Wikibase

View on GitHub

Showing 2,096 of 2,096 total issues

Method __construct has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

        HtmlTermRenderer $htmlTermRenderer,
        LabelDescriptionLookup $labelDescriptionLookup,
        TemplateFactory $templateFactory,
        EditSectionGenerator $sectionEditLinkGenerator,
        LocalizedTextProvider $textProvider,
Severity: Major
Found in repo/includes/ParserOutput/PlaceholderEmittingEntityTermsView.php - About 1 hr to fix

    Method __construct has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            OutputPage $outputPage,
            TermboxRequestInspector $requestInspector,
            TermboxRenderer $termboxRenderer,
            OutputPageEntityIdReader $entityIdReader,
            RepoSpecialPageLinker $specialPageLinker,

      Method __construct has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              IContextSource $context,
              MediaWikiEditEntityFactory $editEntityFactory,
              LoggerInterface $logger,
              EditSummaryFormatter $summaryFormatter,
              PermissionManager $permissionManager,
      Severity: Major
      Found in repo/rest-api/src/Infrastructure/DataAccess/EntityUpdater.php - About 1 hr to fix

        Method __construct has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                $modelId,
                $unused,
                EntityContentDataCodec $contentCodec,
                EntityConstraintProvider $constraintProvider,
                ValidatorErrorLocalizer $errorLocalizer,
        Severity: Major
        Found in repo/includes/Content/EntityHandler.php - About 1 hr to fix

          Method setServices has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  SqlEntityIdPagerFactory $sqlEntityIdPagerFactory,
                  array $existingEntityTypes,
                  EntityPrefetcher $entityPrefetcher,
                  PropertyDataTypeLookup $propertyDataTypeLookup,
                  EntityRevisionLookup $entityRevisionLookup,
          Severity: Major
          Found in repo/maintenance/dumpJson.php - About 1 hr to fix

            Method __construct has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    PatchStatementValidator $useCaseValidator,
                    PatchedStatementValidator $patchedStatementValidator,
                    PatchJson $jsonPatcher,
                    StatementSerializer $statementSerializer,
                    AssertStatementSubjectExists $assertStatementSubjectExists,

              Method __construct has 8 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      TemplateFactory $templateFactory,
                      CacheableEntityTermsView $entityTermsView,
                      LanguageDirectionalityLookup $languageDirectionalityLookup,
                      StatementSectionsView $statementSectionsView,
                      $languageCode,
              Severity: Major
              Found in view/src/ItemView.php - About 1 hr to fix

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

                ( function () {
                    'use strict';
                
                    $( 'form#mw-newentity-form1' ).on( 'submit', function () {
                        $( this ).find( 'button[type=submit]' ).prop( 'disabled', true );
                repo/resources/wikibase.special/wikibase.special.mergeItems.js on lines 1..8

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

                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

                            if ( $items.length ) {
                                lia.liInstance( $items.first() ).focus();
                            } else {
                                this.element.trigger( 'focus' );
                            }
                view/resources/jquery/wikibase/jquery.wikibase.statementgrouplistview.js on lines 232..236

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

                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

                            $siteIdInput.inputautoexpand( {
                                maxWidth: this.element.width() - (
                                    this.$siteIdContainer.outerWidth( true ) - $siteIdInput.width()
                                )
                            } );
                view/resources/jquery/wikibase/jquery.wikibase.sitelinkview.js on lines 103..107

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

                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

                            if ( $items.length ) {
                                lia.liInstance( $items.first() ).focus();
                            } else {
                                this.element.trigger( 'focus' );
                            }
                view/resources/jquery/wikibase/jquery.wikibase.referenceview.js on lines 355..359

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

                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';
                
                    $( 'form#wb-mergeitems-form1' ).on( 'submit', function () {
                        $( this ).find( 'button[type=submit]' ).prop( 'disabled', true );
                repo/resources/wikibase.special/wikibase.special.newEntity.js on lines 1..8

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

                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

                                $siteIdInput.inputautoexpand( {
                                    maxWidth: this.element.width() - (
                                        this.$siteIdContainer.outerWidth( true ) - $siteIdInput.width()
                                    )
                                } );
                view/resources/jquery/wikibase/jquery.wikibase.sitelinkview.js on lines 308..312

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

                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(
                        EntityConstraintProvider $constraintProvider,
                        GuidGenerator $guidGenerator,
                        StatementGuidValidator $guidValidator,
                        StatementGuidParser $guidParser,
                Severity: Minor
                Found in repo/includes/ChangeOp/ChangeOpFactoryProvider.php and 1 other location - About 1 hr to fix
                repo/includes/ParserOutput/PlaceholderExpander/EntityViewPlaceholderExpander.php on lines 68..92

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 100.

                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(
                        TemplateFactory $templateFactory,
                        UserIdentity $user,
                        EntityDocument $entity,
                        array $termsLanguages,
                repo/includes/ChangeOp/ChangeOpFactoryProvider.php on lines 89..118

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

                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 getLabel( EntityId $entityId, string $languageCode ): ?Label {
                        try {
                            $labelFallback = $this->lookupFactory
                                ->newLabelDescriptionLookup( $this->languageFactory->getLanguage( $languageCode ) )
                                ->getLabel( $entityId );
                repo/rest-api/src/Infrastructure/DataAccess/FallbackLookupFactoryTermsRetriever.php on lines 52..65

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

                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 getDescription( EntityId $entityId, string $languageCode ): ?Description {
                        try {
                            $descriptionFallback = $this->lookupFactory
                                ->newLabelDescriptionLookup( $this->languageFactory->getLanguage( $languageCode ) )
                                ->getDescription( $entityId );
                repo/rest-api/src/Infrastructure/DataAccess/FallbackLookupFactoryTermsRetriever.php on lines 37..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 100.

                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

                            if ( !( this.options.value instanceof datamodel.Fingerprint )
                                || !Array.isArray( this.options.userLanguages )
                            ) {
                                throw new Error( 'Required option(s) missing' );
                            }
                view/resources/jquery/wikibase/jquery.wikibase.entitytermsview.js on lines 98..102

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

                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

                            $input
                            .addClass( this.widgetFullName + '-input' )
                            // TODO: Inject correct placeholder via options
                            .attr( 'placeholder', inputPlaceholder )
                            .attr( 'lang', languageCode )
                Severity: Minor
                Found in view/resources/jquery/wikibase/jquery.wikibase.labelview.js and 1 other location - About 55 mins to fix
                view/resources/jquery/wikibase/jquery.wikibase.descriptionview.js on lines 146..161

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

                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

                            if ( !( this.options.value instanceof datamodel.Fingerprint )
                                || !Array.isArray( this.options.userLanguages )
                            ) {
                                throw new Error( 'Required option(s) missing' );
                            }
                view/resources/jquery/wikibase/jquery.wikibase.entitytermsforlanguagelistview.js on lines 89..93

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

                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