wikimedia/mediawiki-extensions-Wikibase

View on GitHub

Showing 1,432 of 2,096 total issues

Method mergeSettings has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        array $defaultSettings,
        array $customSettings,
        array $overrideArrays = [],
        array $twoDArrayMerge = [],
        array $falseMeansRemove = []
Severity: Minor
Found in lib/includes/WikibaseSettings.php - About 35 mins to fix

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

            RepoDomainDb $repoDb,
            string $table,
            string $idColumn,
            int $flags = 0x0,
            int $waitForReplicationTimeout = 2

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

              EntityNamespaceLookup $entityNamespaceLookup,
              PageTableEntityQuery $pageTableEntityConditionGenerator,
              DatabaseEntitySource $entitySource,
              RepoDomainDb $repoDb,
              LoggerInterface $logger = null
      Severity: Minor
      Found in lib/includes/Store/Sql/WikiPageEntityMetaDataLookup.php - About 35 mins to fix

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

                PropertyOrderProvider $propertyOrderProvider,
                TemplateFactory $templateFactory,
                EntityIdFormatter $propertyIdFormatter,
                EditSectionGenerator $sectionEditLinkGenerator,
                StatementHtmlGenerator $statementHtmlGenerator
        Severity: Minor
        Found in view/src/StatementGroupListView.php - About 35 mins to fix

          Method linkMatches has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  ItemId $itemId,
                  SiteLink $siteLink,
                  ?array $numericIds,
                  ?array $siteIds,
                  ?array $pageNames
          Severity: Minor
          Found in lib/includes/Store/HashSiteLinkStore.php - About 35 mins to fix

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

                    TermListSerializer $termListSerializer,
                    AliasGroupListSerializer $aliasGroupListSerializer,
                    StatementListSerializer $statementListSerializer,
                    SiteLinkSerializer $siteLinkSerializer,
                    bool $useObjectsForEmptyMaps

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

                      EntityDiffer $entityDiffer,
                      EntityIdParser $idParser,
                      array $changeClasses,
                      string $defaultEntityChange = EntityChange::class,
                      ?LoggerInterface $logger = null
              Severity: Minor
              Found in lib/packages/wikibase/changes/src/EntityChangeFactory.php - About 35 mins to fix

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

                        DataValueDeserializer $dataValueDeserializer,
                        EntityIdParser $entityIdParser,
                        PropertyDataTypeLookup $dataTypeLookup,
                        array $deserializerBuilders,
                        array $dataTypeToValueTypeMap

                  Function extendVueEnvironment has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      app: App,
                      languageInfoRepo: LanguageInfoRepository,
                      messageRepo: MessagesRepository,
                      repoRouter: MediaWikiRouter,
                      clientRouter: MediaWikiRouter,
                  Severity: Minor
                  Found in client/data-bridge/src/presentation/extendVueEnvironment.ts - About 35 mins to fix

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

                            Deserializer $entityIdDeserializer,
                            Deserializer $termListDeserializer,
                            Deserializer $aliasGroupListDeserializer,
                            Deserializer $statementListDeserializer,
                            Deserializer $siteLinkDeserializer

                      Method processEntityById has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              EntityId $id,
                              EntityId $fromId,
                              PropertyId $propertyId,
                              array $toIds,
                              array &$toVisit

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

                                $moduleName = null,
                                $actionName = null,
                                $languageCode = null,
                                array $commentArgs = [],
                                array $summaryArgs = []
                        Severity: Minor
                        Found in lib/includes/Summary.php - About 35 mins to fix

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

                                  EntityId $fromId,
                                  PropertyId $propertyId,
                                  array $toIds,
                                  $message = null,
                                  Exception $previous = null

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

                                    array $labelChanges,
                                    array $descriptionChanges,
                                    array $statementChanges,
                                    array $siteLinkChanges,
                                    $otherChanges
                            Severity: Minor
                            Found in lib/packages/wikibase/changes/src/EntityDiffChangedAspects.php - About 35 mins to fix

                              Function 69f3 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                              /***/ (function(module, exports, __webpack_require__) {
                              
                              var NATIVE_WEAK_MAP = __webpack_require__("7f9a");
                              var global = __webpack_require__("da84");
                              var isObject = __webpack_require__("861d");
                              Severity: Minor
                              Found in view/lib/wikibase-tainted-ref/dist/tainted-ref.common.js - About 35 mins 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

                              Function da84 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                              /***/ (function(module, exports, __webpack_require__) {
                              
                              /* WEBPACK VAR INJECTION */(function(global) {var check = function (it) {
                                return it && it.Math == Math && it;
                              };
                              Severity: Minor
                              Found in view/lib/wikibase-tainted-ref/dist/tainted-ref.common.js - About 35 mins 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

                              Function mergeChanges has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  private function mergeChanges( EntityId $entityId, array $changes ) {
                                      if ( count( $changes ) === 1 ) {
                                          return reset( $changes );
                                      }
                              
                              
                              Severity: Minor
                              Found in client/includes/Changes/ChangeRunCoalescer.php - About 35 mins 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

                              Function getOtherProjectsSiteIds has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function getOtherProjectsSiteIds( array $siteLinkGroups ) {
                                      $localSite = $this->getLocalSite();
                              
                                      if ( $localSite === null ) {
                                          wfWarn( 'Site not found for ' . $this->localSiteId );
                              Severity: Minor
                              Found in client/includes/OtherProjectsSitesGenerator.php - About 35 mins 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

                              Function addTermsToResult has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  private function addTermsToResult( array $pagesToEntityIds, array $termGroups ): void {
                                      $result = $this->getResult();
                              
                                      foreach ( $pagesToEntityIds as $currentPage => $entityId ) {
                                          if ( !isset( $termGroups[$currentPage] ) ) {
                              Severity: Minor
                              Found in client/includes/Api/PageTerms.php - About 35 mins 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

                              Function render has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function render(
                                      EntityId $entityId,
                                      $propertyLabelOrId,
                                      array $acceptableRanks = null
                                  ) {
                              Severity: Minor
                              Found in client/includes/DataAccess/StatementTransclusionInteractor.php - About 35 mins 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

                              Severity
                              Category
                              Status
                              Source
                              Language