wikimedia/mediawiki-extensions-Wikibase

View on GitHub

Showing 2,096 of 2,096 total issues

Method saveRedirect has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

        EntityRedirect $redirect,
        $summary,
        User $user,
        $flags = 0,
        $baseRevId = false,
Severity: Minor
Found in repo/includes/Store/Sql/WikiPageEntityStore.php - About 45 mins to fix

    Method saveEntity has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            EntityDocument $entity,
            $summary,
            User $user,
            $flags = 0,
            $baseRevId = false,
    Severity: Minor
    Found in repo/includes/Store/Sql/WikiPageEntityStore.php - About 45 mins to fix

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

              DescriptionLookup $descriptionLookup,
              FallbackLabelDescriptionLookupFactory $labelDescriptionLookupFactory,
              NamespaceChecker $namespaceChecker,
              RepoLinker $repoLinker,
              SettingsArray $clientSettings,
      Severity: Minor
      Found in client/includes/Hooks/InfoActionHookHandler.php - About 45 mins to fix

        Method addEntityRevision has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                $sourceEntityIdSerialization,
                EntityRevision $entityRevision,
                $props = 'all',
                array $filterSiteIds = null,
                array $filterLangCodes = [],
        Severity: Minor
        Found in repo/includes/Api/ResultBuilder.php - About 45 mins to fix

          Function validateParameters has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              private function validateParameters( array $params ): void {
                  if ( !( $this->modificationHelper->validateStatementGuid( $params['claim'] ) ) ) {
                      $this->errorReporter->dieError( 'Invalid claim guid', 'invalid-guid' );
                  }
          
          
          Severity: Minor
          Found in repo/includes/Api/SetQualifier.php - About 45 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

          Method getRankedSearchResults has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  $text,
                  $languageCode,
                  $entityType,
                  $limit,
                  $strictLanguage,
          Severity: Minor
          Found in repo/includes/Api/EntityIdSearchHelper.php - About 45 mins to fix

            Method getRankedSearchResults has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    $text,
                    $languageCode,
                    $entityType,
                    $limit,
                    $strictLanguage,
            Severity: Minor
            Found in repo/includes/Api/EntitySearchHelper.php - About 45 mins to fix

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

                      DataTypeFactory $dataTypeFactory,
                      EntityIdFormatterFactory $entityIdFormatterFactory,
                      EntityTitleLookup $entityTitleLookup,
                      FallbackLabelDescriptionLookupFactory $labelDescriptionLookupFactory,
                      PropertyInfoLookup $propertyInfoLookup,
              Severity: Minor
              Found in repo/includes/Specials/SpecialListPropertiesDispatchingFactory.php - About 45 mins to fix

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

                        ApiQuery $query,
                        string $moduleName,
                        AliasTermBuffer $aliasTermBuffer,
                        EntityIdLookup $idLookup,
                        TermBuffer $termBuffer,
                Severity: Minor
                Found in repo/includes/Api/EntityTerms.php - About 45 mins to fix

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

                          SiteLookup $siteLookup,
                          EntityTitleLookup $entityTitleLookup,
                          LanguageNameLookupFactory $languageNameLookupFactory,
                          LoggerInterface $logger,
                          SettingsArray $repoSettings,
                  Severity: Minor
                  Found in repo/includes/Specials/SpecialItemByTitle.php - About 45 mins to fix

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

                            RevisionLookup $revisionLookup,
                            TitleFactory $titleFactory,
                            EntityIdParser $idParser,
                            EntityRevisionLookup $entityRevisionLookup,
                            EntityTitleStoreLookup $entityTitleStoreLookup,
                    Severity: Minor
                    Found in repo/includes/Api/EntityLoadingHelper.php - About 45 mins to fix

                      Function getParser has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private function getParser(): ValueParser {
                              $params = $this->extractRequestParams();
                      
                              $options = $this->getOptionsObject( $params['options'] );
                      
                      
                      Severity: Minor
                      Found in repo/includes/Api/ParseValue.php - About 45 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

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

                              ApiMain $mainModule,
                              string $moduleName,
                              IBufferingStatsdDataFactory $stats,
                              ChangeOpFactoryProvider $changeOpFactoryProvider,
                              EntityFactory $entityFactory,
                      Severity: Minor
                      Found in repo/includes/Api/SetAliases.php - About 45 mins to fix

                        Method attemptSaveMerge has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                Item $fromItem,
                                Item $toItem,
                                ?string $summary,
                                IContextSource $context,
                                bool $bot,
                        Severity: Minor
                        Found in repo/includes/Interactors/ItemMergeInteractor.php - About 45 mins to fix

                          Function parseBadges has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                              private function parseBadges( array $badges, Status $status ) {
                                  $badgesObjects = [];
                          
                                  foreach ( $badges as $badge ) {
                                      try {
                          Severity: Minor
                          Found in repo/includes/Specials/SpecialSetSiteLink.php - About 45 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

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

                                  ApiMain $mainModule,
                                  string $moduleName,
                                  FingerprintChangeOpFactory $termChangeOpFactory,
                                  bool $federatedPropertiesEnabled,
                                  EntityFactory $entityFactory,
                          Severity: Minor
                          Found in repo/includes/Api/SetLabel.php - About 45 mins to fix

                            Function getFormFields has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                                protected function getFormFields(): array {
                                    $formFields = [
                                        self::FIELD_LANG => [
                                            'name' => self::FIELD_LANG,
                                            'class' => HTMLContentLanguageField::class,
                            Severity: Minor
                            Found in repo/includes/Specials/SpecialNewItem.php - About 45 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 loadEntityRevision has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                                protected function loadEntityRevision(
                                    EntityId $entityId,
                                    $revId = 0,
                                    $mode = null
                                ) {
                            Severity: Minor
                            Found in repo/includes/Api/EntityLoadingHelper.php - About 45 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

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

                                    ApiMain $mainModule,
                                    string $moduleName,
                                    FingerprintChangeOpFactory $termChangeOpFactory,
                                    bool $federatedPropertiesEnabled,
                                    EntityFactory $entityFactory,
                            Severity: Minor
                            Found in repo/includes/Api/SetDescription.php - About 45 mins to fix

                              Method initRepoJobServices has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                      EntityLookup $entityLookup,
                                      EntityStore $entityStore,
                                      SummaryFormatter $summaryFormatter,
                                      LoggerInterface $logger,
                                      MediaWikiEditEntityFactory $editEntityFactory,
                              Severity: Minor
                              Found in repo/includes/UpdateRepo/UpdateRepoJob.php - About 45 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language