wikimedia/mediawiki-extensions-Wikibase

View on GitHub

Showing 2,096 of 2,096 total issues

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

        string $title,
        array $tags,
        ChangeOpFactoryProvider $changeOpFactoryProvider,
        SpecialPageCopyrightView $copyrightView,
        SummaryFormatter $summaryFormatter,
Severity: Major
Found in repo/includes/Specials/SpecialModifyTerm.php - About 1 hr to fix

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

            array $tags,
            SpecialPageCopyrightView $copyrightView,
            SummaryFormatter $summaryFormatter,
            EntityTitleLookup $entityTitleLookup,
            MediaWikiEditEntityFactory $editEntityFactory,
    Severity: Major
    Found in repo/includes/Specials/SpecialSetLabelDescriptionAliases.php - About 1 hr to fix

      Method factory has 11 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              AnonymousEditWarningBuilder $anonymousEditWarningBuilder,
              DataTypeFactory $dataTypeFactory,
              MediaWikiEditEntityFactory $editEntityFactory,
              EntityNamespaceLookup $entityNamespaceLookup,
              EntityTitleLookup $entityTitleLookup,
      Severity: Major
      Found in repo/includes/Specials/SpecialNewProperty.php - About 1 hr to fix

        Method factory has 11 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                ApiMain $mainModule,
                string $moduleName,
                ApiHelperFactory $apiHelperFactory,
                DeserializerFactory $deserializerFactory,
                ChangeOpFactoryProvider $changeOpFactoryProvider,
        Severity: Major
        Found in repo/includes/Api/SetReference.php - About 1 hr to fix

          Method factory has 11 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  ApiMain $mainModule,
                  string $moduleName,
                  IBufferingStatsdDataFactory $stats,
                  ApiHelperFactory $apiHelperFactory,
                  ChangeOpFactoryProvider $changeOpFactoryProvider,
          Severity: Major
          Found in repo/includes/Api/SetClaim.php - About 1 hr to fix

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

                    ApiMain $mainModule,
                    string $moduleName,
                    OutputFormatValueFormatterFactory $valueFormatterFactory,
                    OutputFormatSnakFormatterFactory $snakFormatterFactory,
                    DataTypeFactory $dataTypeFactory,
            Severity: Major
            Found in repo/includes/Api/FormatSnakValue.php - About 1 hr to fix

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

                      bool $isWriteMode,
                      $needsToken,
                      RevisionLookup $revisionLookup,
                      TitleFactory $titleFactory,
                      EntityIdParser $idParser,
              Severity: Major
              Found in repo/includes/Api/EntitySavingHelper.php - About 1 hr to fix

                Method factory has 11 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        ApiMain $mainModule,
                        string $moduleName,
                        IBufferingStatsdDataFactory $stats,
                        ApiHelperFactory $apiHelperFactory,
                        DataTypeFactory $dataTypeFactory,
                Severity: Major
                Found in repo/includes/Api/FormatSnakValue.php - About 1 hr to fix

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

                          EntityConstraintProvider $constraintProvider,
                          GuidGenerator $guidGenerator,
                          StatementGuidValidator $guidValidator,
                          StatementGuidParser $guidParser,
                          SnakValidator $snakValidator,
                  Severity: Major
                  Found in repo/includes/ChangeOp/ChangeOpFactoryProvider.php - About 1 hr to fix

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

                            TemplateFactory $templateFactory,
                            UserIdentity $user,
                            EntityDocument $entity,
                            array $termsLanguages,
                            LanguageDirectionalityLookup $languageDirectionalityLookup,

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

                              EntityTermStoreWriter $entityTermStoreWriter,
                              EntityContentDataCodec $contentCodec,
                              EntityConstraintProvider $constraintProvider,
                              ValidatorErrorLocalizer $errorLocalizer,
                              EntityIdParser $entityIdParser,
                      Severity: Major
                      Found in repo/includes/Content/PropertyHandler.php - About 1 hr to fix

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

                            private function handleDescriptionEditSummary( DescriptionEditSummary $editSummary ): FormatableSummary {
                                switch ( $editSummary->getEditAction() ) {
                                    case EditSummary::ADD_ACTION:
                                        return $this->newSummaryForDescriptionEdit( $editSummary, 'add' );
                                    case EditSummary::REPLACE_ACTION:
                        Severity: Major
                        Found in repo/rest-api/src/Infrastructure/EditSummaryFormatter.php and 1 other location - About 1 hr to fix
                        repo/rest-api/src/Infrastructure/EditSummaryFormatter.php on lines 102..113

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

                        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 handleLabelEditSummary( LabelEditSummary $editSummary ): FormatableSummary {
                                switch ( $editSummary->getEditAction() ) {
                                    case EditSummary::ADD_ACTION:
                                        return $this->newSummaryForLabelEdit( $editSummary, 'add' );
                                    case EditSummary::REPLACE_ACTION:
                        Severity: Major
                        Found in repo/rest-api/src/Infrastructure/EditSummaryFormatter.php and 1 other location - About 1 hr to fix
                        repo/rest-api/src/Infrastructure/EditSummaryFormatter.php on lines 115..126

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

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

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

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

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

                        Refactorings

                        Further Reading

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

                        <?php
                        
                        declare( strict_types=1 );
                        namespace Wikibase\Lib\Store\Sql\Terms;
                        
                        
                        lib/includes/Store/Sql/Terms/DatabasePropertyTermStoreWriter.php on lines 1..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 108.

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

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

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

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

                        Refactorings

                        Further Reading

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

                        <?php
                        
                        declare( strict_types=1 );
                        namespace Wikibase\Lib\Store\Sql\Terms;
                        
                        
                        lib/includes/Store/Sql/Terms/DatabaseItemTermStoreWriter.php on lines 1..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 108.

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

                                _createListView: function () {
                                    var self = this,
                                        $listviewParent = null;
                        
                                    // Re-create listview widget if it exists already
                        Severity: Minor
                        Found in view/resources/jquery/wikibase/jquery.wikibase.snaklistview.js - About 1 hr to fix

                          Function _fillMenu has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  _fillMenu: function () {
                                      var self = this,
                                          deferred = $.Deferred(),
                                          // eslint-disable-next-line no-jquery/no-map-util
                                          badgeIds = $.map( this.options.badges, function ( cssClasses, itemId ) {
                          Severity: Minor
                          Found in view/resources/jquery/wikibase/jquery.wikibase.badgeselector.js - About 1 hr to fix

                            Method formatResult has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private function formatResult( IResultWrapper $res, int $limit, array $prop ): void {
                                    $currentPageId = null;
                                    $entry = [];
                                    $count = 0;
                            
                            
                            Severity: Minor
                            Found in client/includes/Api/ApiPropsEntityUsage.php - About 1 hr to fix

                              Function Store has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              var Store = function Store (options) {
                                var this$1$1 = this;
                                if ( options === void 0 ) options = {};
                              
                                {
                              Severity: Minor
                              Found in view/lib/wikibase-tainted-ref/dist/tainted-ref.common.js - About 1 hr to fix

                                Method execute has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function execute() {
                                        $referenceJson = $this->getParameter( 'reference' );
                                        $referenceJsonStatus = FormatJson::parse( $referenceJson, FormatJson::FORCE_ASSOC );
                                
                                        if ( !$referenceJsonStatus->isGood() ) {
                                Severity: Minor
                                Found in client/includes/Api/ApiFormatReference.php - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language